diff --git a/README.md b/README.md index 6304a45..cb0e482 100644 --- a/README.md +++ b/README.md @@ -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*** diff --git a/src/ClickHousePlatform.php b/src/ClickHousePlatform.php index 6dae699..ce3d020 100644 --- a/src/ClickHousePlatform.php +++ b/src/ClickHousePlatform.php @@ -1085,7 +1085,7 @@ public function getDropViewSQL($name) : string */ public function getCreateDatabaseSQL($database) : string { - return 'CREATE DATABASE ' . $this->quoteIdentifier($database); + return 'CREATE DATABASE ' . $database; } /** diff --git a/src/Driver.php b/src/Driver.php index 9f80080..46218d7 100644 --- a/src/Driver.php +++ b/src/Driver.php @@ -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()); }