Skip to content

Allow drivers to return customized begin queries. #296

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

Closed
greg-rychlewski opened this issue Sep 3, 2023 · 2 comments · Fixed by #297
Closed

Allow drivers to return customized begin queries. #296

greg-rychlewski opened this issue Sep 3, 2023 · 2 comments · Fixed by #297

Comments

@greg-rychlewski
Copy link
Member

Problem Statement

I'm looking to add ddl transactions to SQLite. To prevent concurrent migrations I'm trying to use the exclusive transaction shown here: https://www.sqlite.org/lang_transaction.html#deferred_immediate_and_exclusive_transactions

As part of this it would be nice to log/test that the right statements are being executed by the database. But right now db connection will log a generic begin statement because the result from handle_begin is {:ok, result, state}.

Proposal

Allow handle_begin callbacks to return {:ok, query, result, state} in addition to {:ok, result, state} for drivers that can use customized begin queries. This would mirror the way handle_execute enables logging.

@v0idpwn
Copy link
Member

v0idpwn commented Sep 3, 2023

I don't see why not, API seems good.

@josevalim
Copy link
Member

Sounds good to me!

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 a pull request may close this issue.

3 participants