Open tobyxdd opened 2 months ago
I don't think sqlc can handle locking very well because each query is independent, but locks and transactions are highly correlated.
I'm using a postgres database, and my current solution is to handle all operations that require locking as a function (or stored procedure), and then sqlc only makes the calls.
But although this simplifies the work of using sqlc, I need to write a large number of functions in the database.
If you have a better solution, please let me know.
Version
1.26.0
What happened?
https://docs.sqlc.dev/en/latest/howto/transactions.html
In the given example, the code tries to select a row from records and increase the counter by 1 (in a transaction). According to the official MySQL manual:
So, shouldn't
be
in this case?