The consistency checker is read-only. It compares the locked registry with
DatabaseAdapter.introspect() and never changes the database.
const checker = createConsistencyChecker(registry, adapter)
const drift = await checker.check()
if (drift.length) {
for (const table of drift) {
console.error(table.table, table.issues)
}
}
interface SchemaDrift {
table: string
issues: string[]
}
An empty array means the currently supported properties match.
PostgreSQL introspection currently reads base tables in the public schema,
columns, primary keys and indexes. Single-column unique indexes are surfaced as
ColumnMetadata.unique; other indexes become TableMetadata.indexes.
It does not reconstruct:
Declared metadata remains the domain source of truth.
Run the check in CI against a migrated PostgreSQL database, during non-production startup, or as a deployment diagnostic. A clean check complements migrations; it does not replace them.