-
Notifications
You must be signed in to change notification settings - Fork 706
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
feat!: EXPOSED-740 Add support for modes (SKIP LOCKED or NOWAIT) with ForUpdate and ForShare Option for MySQL #2421
feat!: EXPOSED-740 Add support for modes (SKIP LOCKED or NOWAIT) with ForUpdate and ForShare Option for MySQL #2421
Conversation
exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/vendors/ForUpdateOption.kt
Outdated
Show resolved
Hide resolved
return table.selectAll().where { table.id eq id }.forUpdate(option).city() | ||
} | ||
|
||
withDb(TestDB.MYSQL_V8) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know how it's implemented in Postgres tests, but it would be better if you replace the part:
withDb(TestDB.MYSQL_V8) {
withTable {
<code>
}
}
with the following code:
withTables(excludeSettings = TestDB.ALL - TestDB.MYSQL_V8, <table>) {
<code>
}
and remove the method withTable
for that one particular table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if you update Postgres's test like in #2425 also, just some cleanup if we touched that functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the updates to both tests, ty
exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/mysql/MysqlTests.kt
Outdated
Show resolved
Hide resolved
In general it looks good to me. If I'm right this PR contains breaking change. At least the public class Could you mark title of the PR as |
a5f26b8
to
20ae3d4
Compare
@mfazalul Hi, CI has failed. Quite recently we introduced requirements for commit messages to follow conventional commits, and CI validates it. It would be good, if you add prefix You could also recheck |
20ae3d4
to
bceef5f
Compare
@obabichevjb updated, ty. I also see a message
I do not seem to have an option to change the merge method, is that something you can do when merging? |
Thank you for the PR,
I'm not sure you have access for it (as well as for merging PR), but you have option to squash commits in your branch and force push them, in this case PR will be left with only one commit. Anyway, the commits can be squashed in the moment of merge, so it's only the question of passing check for commit names. |
Description
Summary of the change: Adds the
SKIP LOCKED
andNO WAIT
modes when usingSELECT ... FOR UPDATE
. Also adds tests to make sure that the queries are generated as expected. Breaking change: Moved ForUpdateBase outside Postgres.Detailed description:
What:
MODE
option for MySQL, that can be used to define modes for ForUpdate and ForShare.Why:
How:
ForUpdateBase
was moved outside the Postgres implementation to make it available for MySQL as well.sealed class
, and there is some conditional logic to get statements inForUpdateOption
.Type of Change
Updates/remove existing public API methods:
Affected databases:
Checklist
Related Issues