feat(engine): query_select builtin — shared filter/sort/slice/project for list endpoints - #40
Merged
Merged
Conversation
… for list endpoints query_select(items, filter?, order_by?, order_dir?, limit?, offset?, fields?): filter is a list of [field, op, value] triples (AND'ed; ops = != > >= < <= contains startswith endswith in like; dotted field paths; missing field matches only !=), then stable sort, offset/limit, field projection. Numbers compare numerically; ISO-8601 strings chronologically. Adapters translate their provider's query syntax into triples. Wired first in shopify-style (orders: status/financial_status/ fulfillment_status/since_id/ids/created_at_min/max + fields projection) and twilio-style (messages: To/From/DateSent windows, queued excluded).
Review findings on query_select (PR #40): - ordering ops no longer fall through to string-form comparison: numeric field vs numeric string compares numerically (query params arrive as strings), anything else mixed is non-matching - Int vs Int equality/ordering compares exactly via big.Int — snowflake ids (>2^53) no longer collide through float64 - limit/offset check the Int64 ok flag instead of truncating big ints - LIKE operates on runes, so '_' matches one character not one byte - order_dir is case-insensitive; 'DESC' now sorts descending Adapter wiring: shopify fulfillment_status honors unshipped/null (null semantics) and any (no filter), matching the real param space.
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.
query_select(items, filter?, order_by?, order_dir?, limit?, offset?, fields?):
filter is a list of [field, op, value] triples (AND'ed; ops = != > >= < <=
contains startswith endswith in like; dotted field paths; missing field
matches only !=), then stable sort, offset/limit, field projection. Numbers
compare numerically; ISO-8601 strings chronologically. Adapters translate
their provider's query syntax into triples.
Wired first in shopify-style (orders: status/financial_status/
fulfillment_status/since_id/ids/created_at_min/max + fields projection)
and twilio-style (messages: To/From/DateSent windows, queued excluded).