Skip to content

feat(engine): query_select builtin — shared filter/sort/slice/project for list endpoints - #40

Merged
deblasis merged 2 commits into
mainfrom
feat/query-select-builtin
Aug 14, 2026
Merged

feat(engine): query_select builtin — shared filter/sort/slice/project for list endpoints#40
deblasis merged 2 commits into
mainfrom
feat/query-select-builtin

Conversation

@deblasis

Copy link
Copy Markdown
Contributor

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).

… 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.
@deblasis
deblasis merged commit dc62c94 into main Aug 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant