You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e0b472f
Browse filesBrowse the repository at this point in the historyBrowse files
Canonical constraint records for declarative catalogs (vgi.v3)
A declarative Table(constraints=[...]) could not attach: nothing advertised
the constraint read profile, there was no ergonomic way to build a record,
and records DuckDB rejects at ATTACH were served without complaint.
- constraint_record() / ReferencedKey: build a ConstraintInfo from schema
path, table, id, kind and column paths. enforcement and validation are
required keywords; the worker attests its own facts.
- ReadOnlyCatalogInterface.catalog_capabilities() advertises
vgi.constraint.records.read.v1 + vgi.expression.duckdb.scalar.v1 when any
declared table carries records. The worker already selects against the
client's offer after catalog_attach, so attach() overrides cannot drop it.
- validate_constraint_records(): the extension's ATTACH rules. Every record
must be ENFORCED + ALL_ROWS and owned by its table. Arrow nullability must
equal NOT_NULL/PRIMARY_KEY membership, recursing into ordinary structs, and
this applies to tables with no records too. Table.__post_init__ runs it, so
authors' unit tests catch it, and the worker runs it again when serving.
Messages name the table, constraint id and column path.
- The legacy not_null/unique/check/primary_key/foreign_key fields are now
rejected at Table construction, with an error naming constraint_record().
Their dead validation and serialization helpers are removed.
- vgi.catalog re-exports RequiredFilterPaths.
- docs/catalog-interface.md: examples use records, and a Constraints section
covers the three ATTACH rules.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments