Skip to main content

Module database_validator

Module database_validator 

Source
Expand description

Compile-time database validation for schema definitions.

Validates a compiled schema against a live database at three levels:

  • L1: sql_source relation exists in the database
  • L2: Columns and JSON column types match
  • L3: JSONB keys exist in sampled rows (best-effort)

Each finding carries a Severity: error-severity drift (a relation that does not exist, a required field’s key absent from every sampled row) fails compile --database unless --allow-drift is passed (#384); warn-severity findings are always advisory.

Structs§

DatabaseValidationReport
Report containing all database validation warnings and discovered metadata.

Enums§

AnyIntrospector
Enum dispatch for database introspectors.
DatabaseWarning
A single database validation warning.
InjectMiss
Why a relation cannot provide a query filter (#1382, #1394).
QueryFilter
A query filter the runtime lowers onto the relation: what the author declared.

Functions§

create_introspector
Create an introspector from a database URL.
find_unbacked_sources
Find every declared sql_source that is not backed by a live database object, over the shared sql_source_probes work-list (#487).
refuse_removed_engine_url
Refuse a database URL that targets an engine whose support was removed (#374).
validate_schema_against_database
Validate a compiled schema against a live database.