Skip to content

tests(sql) :: add tests that check rewriter guards and what reaches the database - #1422

Merged
lovasoa merged 2 commits into
sqlpage:mainfrom
81reap:mutation/06-test-rewriter
Sep 3, 2026
Merged

tests(sql) :: add tests that check rewriter guards and what reaches the database#1422
lovasoa merged 2 commits into
sqlpage:mainfrom
81reap:mutation/06-test-rewriter

Conversation

@81reap

@81reap 81reap commented Sep 2, 2026

Copy link
Copy Markdown
Contributor
Test Guard
emulated_concat_keeps_nested_call_per_row emulated_function recognises concat, and a sqlpage. call nested inside it stays a per-row call
only_nested_run_sql_requires_buffering must_buffer_rows is false unless a computed column calls sqlpage.run_sql
distinct_is_rejected_only_when_a_projection_is_computed_by_sqlpage select_item_contains_sqlpage. Plain SELECT DISTINCT still reaches the database. Only a SQLPage-computed projection is an error
boolean_literal_stays_a_literal_in_the_static_simple_select the Value::Boolean arm. true as fixed_top_menu becomes a JSON boolean, not a string
with_and_limit_clauses_are_never_folded_into_a_constant_row has_static_simple_select_shape rejects WITH and LIMIT. The INSERT inside the CTE still runs and keeps its binding
a_database_operand_keeps_the_whole_projection_in_the_database projection_is_per_row. 'x' || now() is sent to the database whole, not split
concat_operator_is_rewritten_to_a_function_only_on_sql_server the SupportedDatabase::Mssql guard in database_lowering. || becomes CONCAT on SQL Server and stays || on Postgres
modifiers_on_a_sqlpage_function_are_rejected recognize_sqlpage_function. OVER, FILTER, IGNORE NULLS and WITHIN GROUP on a sqlpage. call are errors, not silently dropped

@81reap
81reap marked this pull request as ready for review September 2, 2026 02:40
@lovasoa
lovasoa marked this pull request as draft September 2, 2026 21:31
@81reap
81reap marked this pull request as ready for review September 2, 2026 21:39
@lovasoa
lovasoa marked this pull request as draft September 2, 2026 21:50
@81reap
81reap marked this pull request as ready for review September 2, 2026 23:35
@lovasoa lovasoa changed the title fix(sql) :: add tests that check rewriter guards and what reaches the database tests(sql) :: add tests that check rewriter guards and what reaches the database Sep 3, 2026
@lovasoa
lovasoa merged commit d41d3e4 into sqlpage:main Sep 3, 2026
51 checks 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.

2 participants