Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
905def3
Postgres parser refuses deep nesting instead of exhausting the stack
kvlonge Nov 7, 2026
46b19ba
fix: bound type nesting and serialize long operator chains without st…
kvlonge Nov 7, 2026
2fc25a8
fix: clone long operator chains without stack overflow
kvlonge Nov 7, 2026
a14bea6
Merge main into the type nesting depth fix
kvlonge Nov 7, 2026
5a9813f
Merge main into the Postgres depth guard
kvlonge Nov 7, 2026
40101be
fix: clone, compare and format deep syntax trees on a grown stack
kvlonge Nov 7, 2026
ea12f0d
Merge main into the type nesting depth fix
kvlonge Nov 7, 2026
9ee5c64
Merge main into the Postgres depth guard
kvlonge Nov 7, 2026
783d26f
Add sqlquack-fingerprint: canonical SQL tokens and change fingerprints
kvlonge Nov 7, 2026
1b1deed
Postgres parser refuses a statement tree deeper than consumers can walk
kvlonge Nov 7, 2026
16176b7
Merge the Snowflake parser grammar checks into the Postgres depth guard
kvlonge Nov 7, 2026
a8fdf9f
Postgres parser README records the tree depth limit and the band the …
kvlonge Nov 7, 2026
f0cd714
Match SQLBuild's message for a scanner token outside the SQL
kvlonge Nov 7, 2026
d538017
fix: serialize deep syntax trees on a grown stack
kvlonge Nov 7, 2026
a34165d
Merge main into the type nesting depth fix
kvlonge Nov 7, 2026
aa98933
Merge the Snowflake grammar checks into the type nesting depth fix
kvlonge Nov 7, 2026
b0f3ce8
Postgres parser keeps remembered trees within the depth limit and clo…
kvlonge Nov 7, 2026
916e56b
coverage: probe every native parser for deep-nesting crashes and hangs
kvlonge Nov 7, 2026
f2f6250
coverage: fail the depth probe on a lost result; probe casts nesting …
kvlonge Nov 7, 2026
99e8a21
coverage: probe BigQuery and chains nested in a chain's first operand
kvlonge Nov 7, 2026
897c4f5
Merge main into the type nesting depth fix and depth probe
kvlonge Nov 7, 2026
0388b67
Postgres parser keeps only failures and non-overlapping JSON_OBJECT t…
kvlonge Nov 7, 2026
8dacf52
fix: drop every node a parser chains in a loop without recursion
kvlonge Nov 7, 2026
5e1e080
Merge the type nesting depth fix into the Postgres depth guard
kvlonge Nov 7, 2026
5e34e9a
coverage: drop the Postgres deep-nesting entries the depth guard fixes
kvlonge Nov 7, 2026
ffbd657
fix: drop TABLESAMPLE and MATCH_RECOGNIZE chains without recursion
kvlonge Nov 7, 2026
aeba313
feat(format): add sqlquack-format, a token-level SQL formatter, with …
kvlonge Nov 7, 2026
6a5f584
Merge the type nesting depth fix into the Postgres depth guard
kvlonge Nov 7, 2026
5c80d8d
feat(format): lay out DuckDB with sqlquack-format
kvlonge Nov 7, 2026
71629f7
feat(format): recase called names and lay out INSERT bodies as SQLCle…
kvlonge Nov 7, 2026
63835cf
Merge the shared fingerprint crate
kvlonge Nov 7, 2026
d2e4c95
Merge the SQLClean landing chain into the Postgres depth guard
kvlonge Nov 7, 2026
746d6e3
feat(lint): port the SQL lint engine
kvlonge Nov 7, 2026
a3e5c23
Merge the lint port landing into the Postgres depth guard
kvlonge Nov 7, 2026
9284258
Postgres parser keeps the memo outcome's doc comment on one line
kvlonge Nov 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ members = [
"crates/sqlquack-polyglot-check",
"crates/sqlquack-syntax-coverage",
"crates/sqlquack-syntax-postgres",
"crates/sqlquack-format",
"crates/sqlquack-format-check",
"crates/sqlquack-lint",
"crates/sqlquack-syntax-bigquery",
"crates/sqlquack-fingerprint",
"crates/sqlquack-python",
]
exclude = ["fuzz"]
Expand Down Expand Up @@ -48,6 +52,7 @@ polyglot-sql = { git = "https://github.com/sqlstack-io/polyglot.git", rev = "7d5
proc-macro2 = "1"
quote = "1"
rayon = "1"
rustc-hash = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# The Python module; abi3, so one build loads into every CPython from 3.12.
Expand All @@ -58,6 +63,9 @@ sqlquack-compare = { path = "crates/sqlquack-compare" }
sqlquack-core = { path = "crates/sqlquack-core" }
sqlquack-duckdb = { path = "crates/sqlquack-duckdb", default-features = false }
sqlquack-evidence = { path = "crates/sqlquack-evidence" }
sqlquack-format = { path = "crates/sqlquack-format" }
sqlquack-fingerprint = { path = "crates/sqlquack-fingerprint" }
sqlquack-lint = { path = "crates/sqlquack-lint" }
sqlquack-policy = { path = "crates/sqlquack-policy" }
sqlquack-rules = { path = "crates/sqlquack-rules" }
sqlquack-semantics = { path = "crates/sqlquack-semantics" }
Expand Down
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ PYTHON_TYPED := scripts tests/unit/scripts python/src $(PYTHON_API_TESTS)
PYTHON_TESTS := tests/unit/scripts $(PYTHON_API_TESTS)
endif

.PHONY: format rust-lint python-check fensu syntax-coverage gate-build evidence-guard polyglot-guard generate-cases generated-cases generate-syntax-cases syntax-cases corpus-rerecord generate-referee-cases referee-cases referee-pending translation-results check-ci check-merge test test-rust test-python python-module python-api python-wheel verify-recorded polyglot-duckshop census-duckshop fuzz-smoke gate gate-parallel census duckshop-compiled duckshop-measure
.PHONY: format rust-lint python-check fensu syntax-coverage depth-probe depth-probe-debug gate-build evidence-guard polyglot-guard generate-cases generated-cases generate-syntax-cases syntax-cases corpus-rerecord generate-referee-cases referee-cases referee-pending translation-results check-ci check-merge test test-rust test-python python-module python-api python-wheel verify-recorded polyglot-duckshop census-duckshop fuzz-smoke gate gate-parallel census duckshop-compiled duckshop-measure

format:
cargo fmt --all
Expand Down Expand Up @@ -62,6 +62,16 @@ fensu:
syntax-coverage: gate-build
$(GATE_DIR)/syntax-coverage diff coverage/syntax/baseline.json

# Fails when a native parser crashes, panics or hangs on deeply nested SQL on a 2 MiB thread and
# coverage/deep-nesting.toml does not list it, or when a listed failure no longer happens.
depth-probe: gate-build
$(GATE_DIR)/syntax-coverage depth-probe --profile $(GATE_PROFILE)

# The same probe on a debug build, whose larger frames fail at shallower depths; not in check-ci.
depth-probe-debug:
cargo build --locked -p sqlquack-syntax-coverage --bin syntax-coverage
$(or $(CARGO_TARGET_DIR),target)/debug/syntax-coverage depth-probe --profile dev

# Fails when a change modifies or deletes a recorded result, or adds an invalid one.
evidence-guard:
uv run python -m scripts.check_evidence_append_only --base $(EVIDENCE_BASE)
Expand Down Expand Up @@ -109,7 +119,7 @@ referee-pending:
uv run python -m scripts.write_referee_pending $(REFEREE_ARGS)

# The static gate, the first step of `gate`, and the Python API's tests.
check-ci: rust-lint python-check fensu syntax-coverage evidence-guard polyglot-guard generated-cases syntax-cases referee-cases python-api
check-ci: rust-lint python-check fensu syntax-coverage depth-probe evidence-guard polyglot-guard generated-cases syntax-cases referee-cases python-api

# The gate builds everything it runs once, in `gate-build`: one profile, GATE_PROFILE (Cargo.toml's
# `gate`), and one feature set, GATE_FEATURES. Cargo unifies features per invocation, so a build of a
Expand Down
7 changes: 7 additions & 0 deletions THIRD_PARTY_NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ The referee corpus referee/corpora/sqlglot.json holds the query statements passe
`validate_identity` and `validate_all` in tests/dialects/test_snowflake.py at the sqlglot commit
its `origin` field names. Only Snowflake's syntax verdict on each statement is recorded.

The formatter corpus crates/sqlquack-format/src/format/tests/fixtures/format_corpus.json holds
SELECT and WITH queries from sqlglot's dialect identity test fixtures, as extracted by polyglot,
with the layouts SQLClean's formatter gives them. It is copied unchanged from SQLClean
(https://github.com/sqlstack-io/sqlclean), with its notice FORMAT_CORPUS_NOTICE.md beside it.

sqlglot is distributed under the following licence:

MIT License
Expand Down Expand Up @@ -58,6 +63,8 @@ SQLQuack's DuckDB result-type rules, in crates/sqlquack-semantics/src/lineage/_h
and duckdb_types.rs, are ported from polyglot's engine type rules, and the fixture
crates/sqlquack-semantics/src/lineage/tests/fixtures/duckdb_engine_types.json is polyglot's
tests/fixtures/engine_types/duckdb.json, the result types DuckDB bound for its synthetic cases.
The lint Rules' scope walk and aggregate classifier, in crates/sqlquack-lint/src/tree, are ported
from polyglot's scope.rs and traversal.rs.

polyglot is distributed under the following licence:

Expand Down
Loading
Loading