Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php bin/console doctrine:database:create does not work #35

Open
mrpavlikov opened this issue Jan 16, 2020 · 1 comment
Open

php bin/console doctrine:database:create does not work #35

mrpavlikov opened this issue Jan 16, 2020 · 1 comment

Comments

@mrpavlikov
Copy link

mrpavlikov commented Jan 16, 2020

Symfony 5.0.2

$ php bin/console doctrine:database:create

throws exception

In Driver.php line 54:
  Connection parameter `dbname` is required                                               

As far as I can see vendor/doctrine/doctrine-bundle/Command/CreateDatabaseDoctrineCommand.php:86 unsets dbname to check whether db exists and connects without driver:

// Need to get rid of _every_ occurrence of dbname from connection configuration and we have already extracted all relevant info from url
unset($params['dbname'], $params['path'], $params['url']);

$tmpConnection = DriverManager::getConnection($params);
$tmpConnection->connect($input->getOption('shard'));
$shouldNotCreateDatabase = $ifNotExists && in_array($name, $tmpConnection->getSchemaManager()->listDatabases());

but \FOD\DBALClickHouse\Driver::connect does not let that.

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

Also there is some problems with quoted identifiers.
Somehow double backticks replaces double-quotes.

Could not create database `metrics` for connection named clickhouse
An exception occurred while executing 'CREATE DATABASE ``metrics``':

Syntax error: failed at position 17: ``metrics``. Expected one of: identifier, IF NOT EXISTS 
IN:CREATE DATABASE ``metrics``

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants