it would be very much appreciated, if you could pass some arguments to the "drush sql-cli" command.

for example:

drush sql-cli -f < myfile.cmd

currently this is not possible, but i guess it won't be that hard?

thanks
kiwi

Comments

greg.1.anderson’s picture

Category: feature » support
Status: Active » Fixed

Your request is a duplicate of #880154: sql-query could take a --file option.. It can also be done today via:

`drush sql-connect` < myfile.cmd

Note the use of backticks to execute the output from the sql-connect command.

neurovation.kiwi’s picture

Category: support » feature

well, looks like i didn't explain correctly what i wanted - my bad.

it would be great if you could use all options that mysql allows and make a "options-passthrough" from drush to mysql. so if i may make some analogy (assuming drush would be a rather simple unix shell script):

drush sql-cli -r <other options> 

would transfer to

mysql -r <oter options> -u user -pass -h host database

so in the examle of my previous post the emphasis is on the -r option - the inputfile is already possible.

is it now clearer what i wanted to achive?

thanks

PS: just realized that this might be a wont-fix cause it would contradict the abstraction level of the db that is actually used?

greg.1.anderson’s picture

I don't see the utility of passing in user / host / database; if you want to change everything around, just call mysql directly. The very utility of sql-cli is that it provides these options for you. If you have a solid use case to merging options in with the ones drush provides, maybe we should join this request with the similar issue #518184: Allow Users To Set myqldump Arguments In drushrc.php (for drush sql dump). ("Patches welcome." :) )

Status: Fixed » Closed (fixed)

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