Skip to content

fix(syntax): typed Snowflake ALTER of application, backup, Cortex Search, database, semantic view and Streamlit kinds - #45

Merged
kvlonge merged 4 commits into
mainfrom
fix/snowflake-alter-batch
Nov 4, 2026
Merged

kvlonge merged 4 commits into
mainfrom
fix/snowflake-alter-batch

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Typed parsing for Snowflake ALTER of the application, backup, Cortex Search, database, semantic view and Streamlit kinds.

  • New snowflake_alter_objects module: ALTER APPLICATION, APPLICATION PACKAGE, APPLICATION SERVICE, BACKUP SET, CORTEX SEARCH SERVICE, DATABASE (including catalog-linked), SEMANTIC VIEW and STREAMLIT parse to a typed AlterObject instead of the opaque fallback.
  • Follows recorded Snowflake refusals: VERSION takes an identifier, CONTACT a name, an UNSET = value a name; a package UNSET takes one property; a database SET ends after a multi-purpose CONTACT list.
  • Reuses the snowflake_alter helpers; merged with fix(syntax): parse Snowflake ALTER FUNCTION, PROCEDURE, SCHEMA, STAGE, SERVICE and 26 more kinds #40 (helper visibility kept at main's pub(super)).
  • Parser tests in tests/parser/test_fixes.rs.

Coverage (D122)

Checker diff against main 00e831a (catalogue 5f35885, receipts at wip/syntax-evidence 469edde): +70 ddl forms complete against the 67-form floor, 0 lost; +2,765 obligations; syntax-coverage diff exit 0.

By kind: APPLICATION* 26, DATABASE 17, BACKUP SET 10, CORTEX SEARCH 8, SEMANTIC VIEW 5, STREAMLIT 5 (counted before the #40 merge; one form fewer after it).

Gate (D94)

CARGO_BUILD_JOBS=1 make check-merge RECORDER=0 RUST_TEST_JOBS=1 on head cc519d5: exit 0. Pre-gate fensu check (0 faults) and cargo clippy -D warnings were clean. main has since gained #44, which touches no syntax code and merges cleanly.

…ce kinds as a typed statement

ALTER APPLICATION, APPLICATION PACKAGE, APPLICATION SERVICE, BACKUP SET,
CORTEX SEARCH SERVICE, DATABASE, SEMANTIC VIEW and STREAMLIT parsed through
the raw ALTER fallback, which accepted malformed statements. They now parse
to AlterObject with the kind, IF EXISTS, the action words and its operands
and properties, and reject missing operands, string or unquoted reserved
names, and half of a multi-word kind (ALTER CORTEX SEARCH, ALTER SEMANTIC,
ALTER BACKUP without SET).
A release directive's VERSION takes an identifier, a CONTACT purpose takes a
contact name, and an UNSET value is a name, not a string. APPLICATION PACKAGE
UNSET takes one property, and a database SET ends after a CONTACT list of
several purposes.
Typed Vec bindings, named TAG/CONTACT constants, matches! or match for literal decisions, helpers that return the action suffix instead of mutating it, and a one-line module summary. Parsing is unchanged: the coverage family and diff output are byte-identical.
Conflicts were helper visibility (main's pub(super) kept) and the ddl module list (both modules kept).
@kvlonge
kvlonge merged commit 5581fa5 into main Nov 4, 2026

kvlonge commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged as 5581fa5 (merge of gated head cc519d5 into main c7fdc39; #44 touches no syntax code, and the merge's sqlquack-syntax tree equals the gated tree).

D94 gate: CARGO_BUILD_JOBS=1 CARGO_TARGET_DIR=… make check-merge RECORDER=0 RUST_TEST_JOBS=1 on cc519d5, exit 0.
D122: +70 ddl forms complete against the 67-form floor, 0 lost (checker diff against main 00e831a, catalogue 5f35885).

kvlonge added a commit that referenced this pull request Nov 4, 2026
Basis: main 5581fa5 (PR #45), catalogue fc0c257, evidence b56cd49,
parser tree 313718f.

- No existing review went stale.
- 69 of the 70 ddl forms PR #45 typed are approved after a page and
  raw-tree read; M2 agrees on every case.
- Not approved: sf.ddl.alter-cortex-search.unset (all-optional UNSET
  positive rejected by Snowflake, identifier rows built on it).

Checker at 5581fa5: valid, 3476 forms; 1310 of 3348 verified.
kvlonge added a commit that referenced this pull request Nov 4, 2026
…ding

- D113 triage of imports 84-86 (evidence a1c9e0f; runs sa-20, sa-21 and
  sa-24). The join found 8 contradictions, all security_admin negatives that
  Snowflake parses. They become undocumented-acceptance rows (observe):
  - CREATE DATA MOVEMENT POLICY ENFORCE_RULES/ALERT_RULES ( 'v1' ):
    errno 2003 x2.
  - CREATE EXTERNAL ACCESS INTEGRATION with string rule, integration and
    secret names: runtime 509009 x3.
  - CREATE FEATURE POLICY BLOCKED_OBJECT_TYPES_FOR_CREATION ( 'INT' ):
    errno 1422.
  - CREATE [ OR ALTER ] DATABASE ROLE ; accepted x2. Snowflake reads these as
    CREATE DATABASE named ROLE. Lane A's per-case restore dropped that
    database.
  security_admin: reject->observe 8, with 128 observed stages updated.
- d118c holds (lane A, packet d118-3296ca13): 42 not_submitted entries.
  - 32 cite alter-function.set kb29b5415441d and alter-procedure.set
    k65020488034f (credential or integration).
  - show-services o067 is the workload_type row renumbered by 3296ca1, still
    held in ux-08.
  - 9 are SYSTEM$SEND_EMAIL, SYSTEM$SEND_SNOWFLAKE_NOTIFICATION and
    SYSTEM$WAIT_FOR_SERVICES rows (out of account, or acting on services).
  The total is now 5,082: ddl 4,399, security_admin 603, functions 40,
  utility 40.
- The two call-with.table-language-sql-as rows of d118c (k5fb30861c6ab,
  k65b59ea8cc0f) are added to held.jsonl, so they run in a run database, as
  the D113b rows do.
- alter-cortex-search.unset: a reading makes PRIMARY KEY required (auditor,
  after #45). `UNSET ;` alone was a rejected positive, and its identifier
  rows were built on it.

The join finds 0 contradictions in functions, utility, security_admin and
ddl.

Rebuilt with, for functions, utility, security_admin and ddl:
  uv run python -m scripts.build_syntax_obligations <family>
  uv run python -m scripts.build_syntax_cases --receipts <evidence a1c9e0f>/coverage/syntax/receipts --setups <evidence a1c9e0f>/coverage/syntax/receipts [--held coverage/syntax/held.jsonl for functions, utility] <family>
Checked with main a2c64d6's checker on this catalogue plus evidence
a1c9e0f: valid, 3476 forms, 48474 receipts.

kvlonge commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Post-merge D94 gate on the merge tree itself (main 5581fa5, i.e. #45 together with #44): CARGO_BUILD_JOBS=1 CARGO_TARGET_DIR=… make check-merge RECORDER=0 RUST_TEST_JOBS=1, exit 0 (fensu 0 faults beforehand). The pre-merge gate had covered head cc519d5 only; this closes that gap.

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