-
-
Notifications
You must be signed in to change notification settings - Fork 520
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
Initial lock support #118
Initial lock support #118
Conversation
71f7f40
to
9a1b771
Compare
Are there blockers that deny merging this PR? |
Sorry was busy. Yes given SeaQuery is upgraded it now can be merged. I think these methods belongs to the I am also thinking of whether we can provide a higher level abstraction over some common scenario? |
Ok for moving the methods. |
I think transaction is highly driver specific. I don't think we can cleanly wrap and generalizes over different database+driver. Perhaps we can start by exposing some of the underlying types and methods from SQLx. https://docs.rs/sqlx/0.5.7/sqlx/trait.Connection.html#method.transaction |
It can be a starting point, if we're able to maintain sea-orm typing. And it's kind of an overkill IMHO, Transaction is only a sugar wrapper over a normal connection, where a START TRANSACTION has been executed. I would prefere an approach like this: https://docs.rs/mysql_async/0.28.0/mysql_async/struct.Conn.html#method.start_transaction About isolation levels, mysql and postgres are quite similars: Sqlite has transactions too, it has a little different dialect, like BEGIN [TRANSACTION] instead of START TRANSACTION, and isolation levels have to be set using the PRAGMA keyword, like https://www.sqlite.org/pragma.html#pragma_read_uncommitted |
Thank you for the investigation. Since this PR is closed, I think it's better we move the discussion to a different thread to follow up. |
Depends on SeaQL/sea-query#117, adds lock support to select statements