Repository navigation
Conversation
…use Recall relations portably SQL Server's render_create_function stripped a table function's SELECT and wrapped it in BEGIN RETURN (...) END, which the engine rejects. A TABLE return now renders RETURNS TABLE AS RETURN (<query>). sqb recall schema --backend warehouse matched state relations with LIKE '\_sqlbuild\_%' ESCAPE '\', which ClickHouse cannot parse. A prefix comparison with SUBSTRING needs no escape in any dialect.
…n and refuse WITH source expressions render_create_schema doubled quotes only in the sys.schemas lookup, so a schema name with a quote broke the EXEC string. render_merge now ends with the semicolon SQL Server requires. A source expression starting with WITH cannot sit in a derived table on SQL Server, so it now fails with A715 and a rewrite hint instead of a warehouse syntax error.
kvlonge
enabled auto-merge (squash)
November 7, 2026 23:25
Contributor
Author
|
Folded into the single combined sqlbuild PR (D625/D626), which the SQLBuild lane is assembling now and opens once #1377 lands. Branch kept. |
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.
Why
Native parser work found SQL that SQLBuild renders but the warehouse rejects:
BEGIN RETURN (<select list>) END); an inline TVF must beRETURNS TABLE AS RETURN (<query>).'broke theEXEC('CREATE SCHEMA …')string.;afterMERGE;render_mergeomitted it (no caller uses it on SQL Server yet).WITHwas wrapped as a derived table, which SQL Server cannot parse.sqb recall schema --backend warehouseusedLIKE … ESCAPE '\', which ClickHouse cannot parse.Changes
TABLEreturn rendersRETURNS TABLE AS RETURN (<query>), keepingSELECTand@namearguments; scalars unchanged.EXEC;MERGEends with;.WITHsource expression fails early withA715and a rewrite hint instead of a warehouse syntax error. Relation names such aswith_ordersare unaffected.SUBSTRING(table_name, 1, 10) = '_sqlbuild_', which needs no escape syntax.Verification
_sqlbuild_fingerprintsand not project tables.make check-cipass locally. No SQL Server or ClickHouse warehouse runs here; CI covers the rest.DuckShop: not applicable; DuckShop runs on DuckDB, which does not use these SQL Server or ClickHouse renderings.