Skip to content

Commit

Permalink
Merge pull request #50 from allok/master
Browse files Browse the repository at this point in the history
'Create database' symfony command support
  • Loading branch information
Sanikovich Aleksey authored Aug 17, 2022
2 parents 75cdb6b + 33a27bd commit 3eb4fb7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ $conn = $this->get('doctrine.dbal.clickhouse_connection');

## Usage

### Create database
```php
php bin/console doctrine:database:create --connection=clickhouse --if-not-exists
```

### Create new table
```php
// ***quick start***
Expand Down
2 changes: 1 addition & 1 deletion src/ClickHousePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ public function getDropViewSQL($name) : string
*/
public function getCreateDatabaseSQL($database) : string
{
return 'CREATE DATABASE ' . $this->quoteIdentifier($database);
return 'CREATE DATABASE ' . $database;
}

/**
Expand Down
4 changes: 0 additions & 4 deletions src/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ public function connect(array $params, $username = null, $password = null, array
throw new ClickHouseException('Connection parameter `port` is required');
}

if (! isset($params['dbname'])) {
throw new ClickHouseException('Connection parameter `dbname` is required');
}

return new ClickHouseConnection($params, (string) $username, (string) $password, $this->getDatabasePlatform());
}

Expand Down

0 comments on commit 3eb4fb7

Please sign in to comment.