feat!: EXPOSED-497 Allow OFFSET without LIMIT in query #2226
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Summary of the change:
This makes it possible to generate SELECT query with OFFSET clause that does not require a LIMIT clause.
Detailed description:
The ability to add OFFSET clause is only available through
SizedIterable.limit()
, forcing some value to also be passed for a LIMIT clause even though most databases support the former without the latter. UsingInt.MAX_VALUE
may not always be sufficient.It is now possible to append either a LIMIT or an OFFSET clause or both, using DSL or DAO, by chaining
SizedIterable.limit().offset()
as needed.SizedIterable.limit(n, offset)
is deprecated and default argument for parameter is removed to avoid conflict with below.SizedIterable
interface has 2 new methods:limit(count)
andoffset(start)
. They both have default implementations so that any custom implementations of the interface do not break. Only a warning will be raised that there is an override of a deprecated member. This allows time to migrate before deprecation level is bumped and brings a full breaking change.SizedIterable
have had the deprecations propagated and new members implemented.FunctionProvider.queryLimit()
is also deprecated andqueryLimitAndOffset()
is added to accept a nullablesize
parameter in the eventlimit()
isn't called.Type of Change
Please mark the relevant options with an "X":
Updates/remove existing public API methods:
Affected databases:
Checklist
Related Issues
EXPOSED-497