Repository navigation
feat!: pin SQLQuack 0.21.0 and bound nested function calls by a configurable depth - #92
Merged
Merged
Conversation
All six sqlquack crates move from the v0.18.1 tag to the v0.20.0 tag together. SQLClean reads none of the tree fields SQLQuack changed in 0.19.0, so no reader changes, and the format corpus is unchanged in every dialect. Lint and format requests take max_function_call_depth, 256 when absent and at most 512. Lint used SQLQuack's fixed 128 before; a format request that left it out had no bound of SQLClean's own. Nesting past the limit is a parse error that names the setting.
The refusal for deep function-call nesting tells the user to raise max_function_call_depth, so sqlclean.toml now has that key (default 256, from 1 to 512). check passes it to the built-in Rules and format and fix pass it to the formatter, whose refusal now names the setting as lint's does. The built-in result cache key includes it. Splitting statements, custom Rules, fix's parse check and facts still parse at the fixed 256 until SQLQuack's parse_sql takes the depth.
Custom Rules, fix's re-parse check, statement splitting for format and sqlclean facts parsed through parse_sql at SQLQuack's fixed default of 256 nested calls, so a file the configured max_function_call_depth accepts was refused there with a hint to raise a setting already raised. SQLQuack's parse_sql now takes the limit. parse_sql, file_facts and statement_ends take it too, and every caller passes the configured value. sqlclean facts reads no configuration, so it takes --max-function-call-depth (default 256, from 1 to 512). A Databricks test covers SQLCLEAN018 and SQLCLEAN043 on a named window defined after a parenthesized query, which SQLQuack 0.20.0 missed. BREAKING CHANGE: parse_sql, file_facts and statement_ends take a max_function_call_depth argument.
All six sqlquack crates move from SQLQuack's main commit to the v0.21.0 tag. 0.21.0 resolves a named window written after a parenthesized query, so SQLCLEAN018 and SQLCLEAN043 check Databricks (SELECT ... OVER w ...) WINDOW w AS (...) again, and its parse_sql takes the call-depth limit SQLClean now passes everywhere.
The lint and format call-depth tests assert against their expected outcomes without branching, and move with the Databricks named-window test out of the oversized lint test file. The default and maximum depth are SQLClean constants rather than a re-export. The format e2e test also covers the default limit, which leaves 300 nested calls as written and names the key that raises it.
Deploying sqlclean with
|
| Latest commit: |
2cfaf40
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://62261188.sqlclean.pages.dev |
| Branch Preview URL: | https://feat-sqlquack-0-21-call-dept.sqlclean.pages.dev |
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
SQLQuack 0.21.0 is published. SQLClean pinned 0.18.1, and SQLClean and SQLBuild link one SQLQuack, so SQLClean moves first. 0.19.0 to 0.21.0 also bound nested function calls, and SQLClean had no setting for that limit: custom Rules, fix's re-parse check, format's statement split and
sqlclean factsall parsed at a fixed 256.An earlier commit on this branch said SQLClean reads none of the tree fields SQLQuack changed. That is wrong.
sql_factswalks SQLQuack's CTE, join, table and column nodes, and built-in Rules run on SQLQuack's trees inside sqlquack-lint. On 0.20.0, SQLCLEAN018 and SQLCLEAN043 were silent for a Databricks(SELECT ... OVER w ...) WINDOW w AS (...); 0.21.0 fixes that.Changes
sqlquack-*crates to the v0.21.0 tag.sqlclean.tomlkeymax_function_call_depth(default 256, from 1 to 512), used by built-in Rules (and their cache key), custom Rules, format, fix and its re-parse check. Nesting past it is aSQLCLEAN999finding, or a format refusal that leaves the file as written; both name the key.sqlclean factstakes--max-function-call-depth, since it reads no configuration.parse_sql,file_factsandstatement_endstake the limit.BREAKING CHANGE: format requests without a depth were unbounded and are now bounded at 256; a depth above 512 is declined;
parse_sql,file_factsandstatement_endstake amax_function_call_depthargument.Verification
cargo test --all(41 + 8) and Python tests (76) pass;make check-cipasses.facts,formatandcheckmatch the 0.9.7 release byte for byte on the Snowflake comparison files.