Skip to content

Commit

Permalink
create database support
Browse files Browse the repository at this point in the history
  • Loading branch information
aliaksei.sanikovich authored and aliaksei.sanikovich committed Aug 17, 2022
1 parent 75cdb6b commit 33a27bd
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 33a27bd

Please sign in to comment.