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

SQL commands inside hook methods #31

Open
fadc80 opened this issue Feb 19, 2020 · 1 comment
Open

SQL commands inside hook methods #31

fadc80 opened this issue Feb 19, 2020 · 1 comment

Comments

@fadc80
Copy link

fadc80 commented Feb 19, 2020

I would like to execute SQL commands inside the hook methods. These commands must be on the same transaction of the original command. I mean the one triggered by the programmer using the database/sql API. I have to do this transparently. Do you think it is feseable and straightforward to implement? I guess I would have to add extra parameters to the hook methods' signatures. However, I am wondering how I could append these extra comands to the ongoing transaction.

@fadc80 fadc80 changed the title Executing SQL commands inside hook methods SQL commands inside hook methods Feb 19, 2020
@qustavo
Copy link
Owner

qustavo commented Feb 19, 2020

I'm not sure if sqlhooks can attach to transactions, but if that's the case, I think you could use the context to save a reference to the tx and then retrieve it.
Again, I'm not sure about this.

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

2 participants