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

Internal calls to query() in sql commands should run even in --simulate ... #1005

Merged
merged 1 commit into from
Nov 21, 2014

Conversation

weitzman
Copy link
Member

Currently, sql-dump --simulate does not work properly as table selection queries do not run (because we are in simulate mode). That can be fixed in an ugly way by this PR or perhaps we should just use drush_invoke_process() with override-simulated backend option instead. My annoyance with that approach is that you have to decide whether or not to $integrate the log for the backend call. I wish we could integrate only in the case of errors. Because usually, $integrate just adds noise.

…te mode as they are needed to build sql-dump sql, for example.
@weitzman weitzman assigned weitzman and greg-1-anderson and unassigned weitzman Nov 21, 2014
@weitzman
Copy link
Member Author

Assigning to Greg. Anyone else is welcome to chime in.

@greg-1-anderson
Copy link
Member

I think that in the short term, we should just commit the patch submitted. A better solution would be to make the query function take a parameter that controlled whether or not the function was simulated or not. In order to do this, though, I think we'd want to implement the object-based context system, and pass the active context around as a parameter to most worker functions. Then, we would have $context->get_option(...) instead of drush_get_option(). This would make it easy for code that needs to do special-purpose operations, like override simulated, easy to manage. This would take a fairly sweeping change to Drush, though, which is why I favor just putting in the quick fix.

weitzman added a commit that referenced this pull request Nov 21, 2014
Internal calls to query() in sql commands should run even in --simulate ...
@weitzman weitzman merged commit 406d78a into master Nov 21, 2014
@weitzman weitzman deleted the override-simulated branch November 21, 2014 16:52
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

Successfully merging this pull request may close these issues.

2 participants