Replies: 1 comment
-
I decided to go with 1st approach as you can't really use transactions with 2nd approach. The queries struct has DBTX interface unexported |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
From the sqlc docs,
The
queries
struct is initialized once and used for all subsequent db operations. It makes sense since we are calling them sequentially.However I have use-case where concurrent db-operations might happen. In this case, should queries struct be initialized each-time the db-operation is called
OR
Can I pass reference of queries struct and use it concurrently in my db-operations
Beta Was this translation helpful? Give feedback.
All reactions