Skip to content

Chain params, lower() in LIKE, project AS aliases - #15

Merged
adsharma merged 1 commit into
mainfrom
chain-params-alias
Oct 5, 2026
Merged

adsharma merged 1 commit into
mainfrom
chain-params-alias

Conversation

@adsharma

@adsharma adsharma commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Follow-up to #13, driven by flipping production reads onto chains:

  • param("name") in any value position (comparisons, LIKE/MATCH patterns); resolved against the params dict at render time, missing names raise. User input never touches SQL text.
  • like() accepts lower(field) as its field argument (case-insensitive autocomplete).
  • project() accepts alias.col AS out (case-insensitive AS) so joined projections with same-named columns don't collide in dict rows.
  • to_sql(params) / to_rows(conn, params) thread the bindings through.

Tests in tests/test_sql.py cover all three, incl. a quote-containing bound value.

param("name") references in any value position, resolved against the params dict at render (missing -> ValueError). like() accepts a lower() wrapped field. project() accepts 'alias.col AS out' for disambiguating joined projections.
@adsharma
adsharma force-pushed the chain-params-alias branch from b32c8a1 to be33870 Compare October 5, 2026 04:51
@adsharma
adsharma merged commit b7393c9 into main Oct 5, 2026
2 checks passed
@adsharma
adsharma deleted the chain-params-alias branch October 5, 2026 04:52
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