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

How get the query's Result on After Hook? #55

Open
ja1felipe opened this issue Apr 24, 2024 · 1 comment
Open

How get the query's Result on After Hook? #55

ja1felipe opened this issue Apr 24, 2024 · 1 comment

Comments

@ja1felipe
Copy link

I'm using the hooks to create audit_logs for my project, I'm using the idea of this lib https://github.com/gmhafiz/audit but in this lib, the author uses a personalized version of sqlhooks (u can check this in the go.mod) that receive a driver.Result that has the LastInsertId() that he uses to populate the RowId in his audit struct.

My goal is to be able to use these Hooks to get the ID of the last record inserted on my Postgres database in a similar way.

@qustavo
Copy link
Owner

qustavo commented Apr 26, 2024

I saw the sqlhooks-gmhafiz replacement but I don't have access to that code, do you happen to have?

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