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

[question] how to capture all SQL so that it can be applied by some other tool? #294

Open
danhaywood opened this issue Jan 23, 2023 · 1 comment

Comments

@danhaywood
Copy link

Our DBAs like to use their own tooling for any scripts to be applied into production, and they have a process whereby the rehearse running in the scripts against a staging environment, then run it in "for real" against prod.

I'm trying to integrate Evolve with this process. My thinking is to run Evolve with --transaction-mode RollbackOnly, but ... somehow ... capture a log of all the SQL that Evolve would have run in. Then, take this SQL and package it into a format for our DBAs to run.

Looking at the code, I see that the SQL is available in WrappedConnectionEx#Execute(...), but I can't see any obvious way of being able to append that SQL into a log.

Is there any way to accomplish this requirement? If not, would you accept a PR to add in this capability?

@danhaywood
Copy link
Author

I've found a bit of a workaround, which is to implement a decorator of DbConnection (following this blog post) and then write my own CLI which uses Evolve as a nuget package. But it would still be nice if this capability was available in the Evolve CLI itself.

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

1 participant