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

Support "limit" and "order by" on DELETE and UPDATE Statements #544

Merged
merged 15 commits into from Nov 2, 2022

Conversation

jeffgbutler
Copy link
Member

This PR adds the ability to specify limit and orderBy in the DELETE and UPDATE DSL. For example (Kotlin):

val updateStatement = update(items) {
    set(amount) equalTo add(amount, constant<Int>("100"))
    orderBy(amount.descending())
    limit(4)
}

This capability is not supported by all databases, so please test before using.

Resolves #542

@jeffgbutler jeffgbutler added this to the 1.5.0 milestone Nov 2, 2022
@coveralls
Copy link

coveralls commented Nov 2, 2022

Coverage Status

Coverage remained the same at 100.0% when pulling 5c2f5b2 on jeffgbutler:limit-delete-update into 95d866a on mybatis:master.

@jeffgbutler jeffgbutler merged commit 17ffeb7 into mybatis:master Nov 2, 2022
@jeffgbutler jeffgbutler deleted the limit-delete-update branch November 2, 2022 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dynamic delete-sql not supported LIMIT and ORDER BY syntax
2 participants