Skip to content

Commit 3eb4fb7

Browse files
author
Sanikovich Aleksey
authored
Merge pull request #50 from allok/master
'Create database' symfony command support
2 parents 75cdb6b + 33a27bd commit 3eb4fb7

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ $conn = $this->get('doctrine.dbal.clickhouse_connection');
6969

7070
## Usage
7171

72+
### Create database
73+
```php
74+
php bin/console doctrine:database:create --connection=clickhouse --if-not-exists
75+
```
76+
7277
### Create new table
7378
```php
7479
// ***quick start***

src/ClickHousePlatform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ public function getDropViewSQL($name) : string
10851085
*/
10861086
public function getCreateDatabaseSQL($database) : string
10871087
{
1088-
return 'CREATE DATABASE ' . $this->quoteIdentifier($database);
1088+
return 'CREATE DATABASE ' . $database;
10891089
}
10901090

10911091
/**

src/Driver.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ public function connect(array $params, $username = null, $password = null, array
5050
throw new ClickHouseException('Connection parameter `port` is required');
5151
}
5252

53-
if (! isset($params['dbname'])) {
54-
throw new ClickHouseException('Connection parameter `dbname` is required');
55-
}
56-
5753
return new ClickHouseConnection($params, (string) $username, (string) $password, $this->getDatabasePlatform());
5854
}
5955

0 commit comments

Comments
 (0)