Skip to content

fix(blocks): refuse a requested bind check when built without DuckDB - #347

Merged
kvlonge merged 3 commits into
mainfrom
fix/refuse-bind-without-engine
Nov 30, 2026
Merged

kvlonge merged 3 commits into
mainfrom
fix/refuse-bind-without-engine

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Why

Built without DuckDB's engine feature, the printed-SQL check passed every statement that passed its lexical checks. A conversion that asked for the bind check therefore got none, and nothing said so. The Databricks, PostgreSQL and SQLite pipelines always ask for it, so linking sqlbabel-convert without the engine would silently drop their bind check.

Changes

  • Without the engine, check_printed now fails at the Engine stage ("this build has no DuckDB engine, so nothing can bind the SQL"), and the statement is refused instead of passing.
  • Callers that bind the SQL themselves skip the check explicitly. The browser playground, which runs the SQL in DuckDB-WASM, now sets skip_bind_check. Its behaviour is unchanged, because the old engine-free check was the lexical check alone.
  • sqlbabel-convert's own tests enable the engine, as every other build of it does. cargo tree -e normal for the crate still has no DuckDB.
  • make engine-free also runs the checking tests without the engine, which no other build does, and fails if none run.
  • docs/architecture.md describes the new behaviour.

Verification

  • cargo test -p sqlbabel-blocks --lib checking:: without the engine: 4 pass. With the old bound, 3 of the 4 fail (left: None, right: Some(Engine)), which is the silent pass this removes.
  • sqlbabel-convert Snowflake analysis tests with the engine: 3 pass.
  • make engine-free passes, and fails with a filter that matches no test.
  • clippy -D warnings on both crates, cargo fmt --check, the clutter guard.

Without the engine feature, the printed-SQL check passed every statement that
passed its lexical checks, so a conversion that asked for the bind check got
none and was not told. The Databricks, PostgreSQL and SQLite pipelines always
ask for it. The check now fails at the engine stage, and the statement is
refused naming the missing engine. The browser playground, which runs the SQL
in DuckDB-WASM, now skips the check explicitly. make engine-free runs the
checking tests without the engine, which no other build does.
…ip advice

The engine-free target now fails if its filter matches no test. The refusal
message no longer tells the reader to skip the bind check, which the Databricks,
PostgreSQL and SQLite pipelines do not offer.
@kvlonge
kvlonge enabled auto-merge November 30, 2026 14:02
Split the test helper by feature instead of matching on the stage, and keep
each doc comment to one line, as the layout rules require.
@kvlonge
kvlonge added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 45ee8bf Nov 30, 2026
10 checks passed
@kvlonge
kvlonge deleted the fix/refuse-bind-without-engine branch November 30, 2026 15:31
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