drush-ops / drush

Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt.
https://www.drush.org
2.34k stars 1.08k forks source link

SqlSqlite::creds() ignores prefix #3912

Open RoSk0 opened 5 years ago

RoSk0 commented 5 years ago

Describe the bug

SQLite driver, SqlSqlite::creds() ignores prefix completely when it should treat it as core driver do, adding as suffix to the DB file name (see Drupal\Core\Database\Driver\sqlite\Connection::__construct() ).

To Reproduce $ ./drush si --yes --db-url=sqlite://drupal.sqlite --db-prefix='db_prefix' minimal $ ./drush sqlq '.databases' main: /home/kirill/projects/drush/sut/drupal.sqlite

Expected behavior $ ./drush sqlq '.databases' main: /home/kirill/projects/drush/sut/drupal.sqlite db_prefix: /home/kirill/projects/drush/sut/drupal.sqlite-db_prefix

Workaround Export queries ran by core in Drupal\Core\Database\Driver\sqlite\Connection::__construct() to a file and add that to sqlite3 -init option.

System Configuration

Q A
Drush version? 9.x-dev
Drupal version? SUT
PHP version 7.0
OS? Linux
greg-1-anderson commented 5 years ago

db_prefix is only lightly used, and support for it is lacking in many areas of Drush. PRs are welcome.

greg-1-anderson commented 5 years ago

Didn't see #3849 earlier. 👍