Skip to content

playground: a sample schema, help for an undeclared table, and conversion notes - #132

Merged
kvlonge merged 4 commits into
mainfrom
feat/playground-sample-schema
Nov 7, 2026
Merged

kvlonge merged 4 commits into
mainfrom
feat/playground-sample-schema

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

D321, with the coordinator's D316 note addition.

  • Sample schema. The schema box starts with ORDERS (unchanged, so the examples keep their outcomes), CUSTOMERS, PRODUCTS, ORDER_ITEMS and EVENTS (EVENT_ID, CUSTOMER_ID, EVENT_TYPE, OCCURRED_AT TIMESTAMP_NTZ, PAYLOAD VARIANT), with fixture rows for each.
  • Undeclared table. When SQ0004 names a relation with no known columns, the Translate stage shows one line, "SQLQuack needs each table's columns and Snowflake types. Add T to the Schema box.", and an "Add T to schema" button. The button appends "T": [["COLUMN_NAME", "SNOWFLAKE_TYPE"]] and selects the placeholder. Nothing is inferred: the placeholder type is not a Snowflake type, so the statement stays refused (SQ0004) until it's filled in, and the hint then reads "Fill in T's …".
  • Conversion notes. The wasm report now lists, per translated statement, each known divergence it relies on (id, constructs, the policy's reason). The page shows each one, and any translate.notes, as a note rather than an error. So any warn-level divergence, including D316's clock and time-zone caveat if it comes through as an allowed divergence, reaches visitors the same way.
  • Run errors as Snowflake's. When translated SQL raises one of Snowflake's errors (a building block's tagged raise, such as 100038 on CAST('shipped' AS NUMBER)), the Run stage shows error[100038]: Numeric value is not recognized with a caret under the expression that raised it, and also underlines it in the editor. DuckDB's own message, which wraps the raw tag, is no longer shown. The engine lists each statement's raise IDs with their source locations, and the new run_failure export reads the DuckDB error back with sqlquack-core's duckdb_failure and raise_id.

Engine changes are in website/wasm only. The core crates are unchanged.

Checks: build_engine, build, check_figures, check_links (17 pages, 0 broken), test:engine 10/10 (three new tests), generate_diagnostics --check, cargo fmt. In agent-browser at 1280 and 390: every example stops at its intended stage, and valid and decimal still run in DuckDB-WASM with the same rows. SELECT * FROM customers and a CUSTOMERS–ORDERS join run, and the hint, button and note render without overflow.

Known, and not part of this PR: on main, under the built-in default, SELECT … FROM events refuses with SQ0008 json_fidelity (fixed by D322 in fix/builtin-launch-refusals), and SUM(quantity) over NUMBER(38,0) refuses with SQ0008 numeric_range.

…sion notes

The schema box starts with ORDERS, CUSTOMERS, PRODUCTS, ORDER_ITEMS and
EVENTS (with a VARIANT payload and timestamps), and the fixture rows fill
each, so common queries translate and run without editing the schema.

When a statement reads a table the schema does not declare, the Translate
stage says SQLQuack needs its columns and Snowflake types and offers to add
a stub entry to fill in. The stub's placeholder type is not a type, so the
statement stays refused until it is filled in; nothing is inferred.

Each known divergence a translation relies on, which the policy allows, is
shown as a note with the policy's reason, as convert names it on standard
error. The engine reports them per statement, and any notes the report
carries are shown the same way.
…ised

A building block raises Snowflake's errors as tagged text, which DuckDB
reports inside its own message, such as a failed cast of the tag. The
engine now lists each statement's raise IDs with their source locations,
and run_failure reads a DuckDB error back as the Snowflake error number,
SQLSTATE and message. The Run stage shows that error and underlines the
expression that raised it, instead of DuckDB's message.
kvlonge added a commit that referenced this pull request Nov 6, 2026
An assumption gives a wrong value silently where it does not hold, so the
note says "Relies on assumption", as convert does, instead of "known
divergence". An id with a suffix, such as declared_offset:REL.COL, takes
its reason from the divergence before the colon. The page no longer reads
a notes list the engine does not report.

kvlonge commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

D94 gate passed on the exact head c2cbe9d (#132 at 8f8b12e, merged with main 9c008e0), auditor approval record 698b87b.

  • make check-merge RECORDER=0: exit 0 in 41m26s. fensu reported 0 faults.
  • make verify-recorded: exit 0 in 21m50s. 12,033 cases: 7,997 passed, 1,035 diverged as expected, 2,964 refused, 37 typed, 0 pending, 0 unproven, 0 failed; 226 of 226 equivalences and rules verified. The translation results have 0 regressions against the baseline.
  • The public-repository hygiene scan is clean.

GitHub Actions can't run because of the account billing block, so this local gate is the check for this landing.

@kvlonge
kvlonge merged commit c2cbe9d into main Nov 7, 2026
1 of 2 checks passed
@kvlonge
kvlonge deleted the feat/playground-sample-schema branch November 9, 2026 21: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