I recently updated to the 6.0-beta and it looks like the database flag isn't supported by drush currently. Is there another way of connecting to other databases now? I'm probably just missing something simple. Thanks

Comments

moshe weitzman’s picture

Status: Active » Fixed

It looks like the only way now is to pass in a full --db-url. I don't recall why we removed this. You'd have to review the git logs or search the closed issues.

rballou’s picture

From glancing at the code, it seems like this still may be there, but not recognized? http://drupalcode.org/project/drush.git/blob/refs/heads/8.x-6.x:/command...

greg.1.anderson’s picture

I think that what happened here is that _drush_sql_connect used to use drush_get_option to determine which database to connect to, but somewhere back in Drush 3, this was cleaned up such that the caller was expected to set up the appropriate database settings before making the function call, to insure that a --database option did not affect some call that it should not have. However, sql-cli was inadvertantly missed.

greg.1.anderson’s picture

Status: Fixed » Needs review
StatusFileSize
new735 bytes

I think this should more or less do it, but I haven't really tested it.

rballou’s picture

StatusFileSize
new567 bytes

I tried that patch, but it doesn't seem to work for me. Looking closer at sql_drush_command it seems that $options is not passed to the sql-cli item. I'm not sure if #4 is needed or not (in my tests it worked without it, but that might still be needed).

moshe weitzman’s picture

Status: Needs review » Fixed

I committed #5, since it looks necessary. #4looks optional, since the same code gets executed later, if a $db_spec is not provided.

It would be good if someone reviewed other sql commands to see if we omitted more instances of $options.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.