Skip to content

refactor: read every state table name from sqlbuild-core - #1423

Merged
kvlonge merged 1 commit into
mainfrom
fix/state-table-constants
Nov 12, 2026
Merged

kvlonge merged 1 commit into
mainfrom
fix/state-table-constants

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Why

SQLBuild writes ten warehouse state tables, and STATE_TABLE_NAMES in sqlbuild-core is meant to be their one list. Four names (microbatches, node results, audit results, janitor events) were still separate Python literals, and several Rust paths repeated table names as strings, so a rename could drift between the executor, the location sync and the janitor.

Changes

  • The native module exports all ten state table names. Python imports the four that were literals from sqlbuild._native, and their Python definitions are deleted.
  • Rust uses the sqlbuild-core constants in the warehouse metadata reads, the microbatch statements and the fingerprint and freshness ingest. The values are identical, so event IDs do not change.
  • The microbatch table name no longer round-trips through the Python host table; its host entry is removed in every registry.
  • The five SQL Server state-table builders share one helper instead of repeating the build, strip and wrap steps. Their SQL is byte-identical to before.

DuckShop edge case: not applicable. No project shape, data value or lifecycle changes; this only changes where existing names come from.

Verification

  • make check-ci passes (ruff, ty, fensu, workspace clippy).
  • 1,678 unit tests across adapters, executor, microbatches and native module paths, plus 318 state-table integration tests, including the served-location warehouse metadata sync.
  • SQL Server builder output compared with origin/main for five builders and several database and schema values: identical.
  • One independent review: no findings.

The microbatch, node result, audit result and janitor event table names
were still separate Python literals, and a few Rust paths repeated the
table names as strings. Python now imports all ten names from the native
module, and Rust uses the sqlbuild-core constants. The microbatch table
name no longer round-trips through the Python host table.

The SQL Server state table builders share one helper instead of five
copies of the same build, strip and wrap steps; their SQL is unchanged.
@kvlonge kvlonge added the full-verify Run the full Verify matrix on this pull request label Nov 12, 2026 — with Amp for GitHub
@chio-labs-delivery
chio-labs-delivery Bot added this pull request to the merge queue Nov 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 12, 2026
@kvlonge
kvlonge added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit f09b69b Nov 12, 2026
75 of 78 checks passed
@kvlonge
kvlonge deleted the fix/state-table-constants branch November 12, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-verify Run the full Verify matrix on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant