Repository navigation
feat(analysis): type BETWEEN and NOT BETWEEN range bound placeholders - #30
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
Range predicates on a direct column now produce typed method parameters. Before this change,
BETWEEN $1 AND $2was rejected as an unanalyzed placeholder location, and a named bound such as:locould reach the executable SQL unbound. Each$Nbound of<column> BETWEEN ... AND ...andNOT BETWEENnow takes the tested column's type and binds in textual order.Changes
BETWEENandNOT BETWEENon a direct, optionally qualified column in aSELECT,UPDATE, orDELETEWHEREclause bind each$Nbound typed from that column. The start bound binds before the end bound, whatever their placeholder indexes are.id BETWEEN :lo AND :hifails with the named-parameter diagnostic.$1 BETWEEN id AND id) or inside a computed bound (id BETWEEN $1 + 1 AND $2) is still rejected as an unanalyzed placeholder location.code BETWEEN $1 AND $2generatescode1andcode2.BETWEENread and aNOT BETWEENread with out-of-order placeholder indexes.Scope and non-goals
BETWEEN SYMMETRIC, column-type restrictions on range bounds, and column resolution for a range with no placeholder bound are not included.