Repository navigation
feat(analysis): type LIMIT and OFFSET pagination placeholders - #31
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Read queries can now page their rows with parameterized
LIMITandOFFSET. Previously a$Nplaceholder in either clause was rejected as an unanalyzed location, and a named:nvalue was accepted but reached the executable SQL unbound.Changes
$NLIMITrow count becomes anIntegerparameter namedlimit, and a$NOFFSETvalue becomes anIntegerparameter namedoffset.WHEREparameter, in textual order, soOFFSET $2 LIMIT $1binds the offset first while the method still takes(limit, offset).ALLvalue contributes no parameter, soLIMIT ALL OFFSET $1binds only the offset andLIMIT 10 OFFSET 5binds nothing.LIMIT :norOFFSET :nis rejected with the existing named-parameter diagnostic.LIMIT $1 + 1), in theLIMIT a, bform, or inFETCH FIRST $1 ROWS ONLYremains rejected.Scope and non-goals
SELECTpagination is analyzed;UPDATEandDELETEare unchanged.FETCH,LIMIT a, b, and computed pagination values are not supported with placeholders.