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 OFFSET on SQL builder class #1521

Merged
merged 2 commits into from Jun 16, 2019

Conversation

@kazuki43zoo
Copy link
Member

commented Apr 14, 2019

Fixes gh-1518

@kazuki43zoo

This comment has been minimized.

Copy link
Member Author

commented Apr 14, 2019

I've fixed gh-1518.

  • Supports the LIMIT on select/update/delete
  • Supports the OFFSET on select

WDYT?

@kazuki43zoo kazuki43zoo self-assigned this Apr 14, 2019

@kezhenxu94
Copy link
Contributor

left a comment

LGTM. Useful feature 👍

@harawata

This comment has been minimized.

Copy link
Member

commented Jun 15, 2019

@jeffgbutler ,
You recently added LIMIT/OFFSET support to dynamic-sql.
Are you OK with this, too?

@jeffgbutler

This comment has been minimized.

Copy link
Member

commented Jun 15, 2019

I am OK with this.

I tried to make clear in the dynamic-sql documentation that this isn’t a “magic” method meaning that it won’t translate to something else for databases that don’t support limit and offset. But most databases do support it now so the caution is mainly for Oracle users :)

@harawata

This comment has been minimized.

Copy link
Member

commented Jun 15, 2019

Thank you, @jeffgbutler !

I just checked and ANSI SQL chose FETCH FIRST as the default syntax, it seems.
https://en.wikipedia.org/wiki/Select_(SQL)#FETCH_FIRST_clause
And popular DBs started supporting this syntax.

Anyway, I agree that LIMIT/OFFSET still is a popular syntax, so I also have no objection.
@kazuki43zoo Your call. :)

@kazuki43zoo

This comment has been minimized.

Copy link
Member Author

commented Jun 16, 2019

@harawata @jeffgbutler @kezhenxu94 Thanks for your review!

I will merge this PR after updating documentation(plant to includes the note that same as mybatis-synamic-sql). And I consider to support "FETCH FIRST" clause by another issue.

Thank you again!

@kazuki43zoo kazuki43zoo added this to the 3.5.2 milestone Jun 16, 2019

@kazuki43zoo kazuki43zoo merged commit 528d923 into mybatis:master Jun 16, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@kazuki43zoo kazuki43zoo deleted the kazuki43zoo:gh-1518 branch Jun 16, 2019

@kazuki43zoo kazuki43zoo changed the title Support LIMIT and OFFSET on SQL class Support LIMIT and OFFSET on SQL builder class Jul 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.