introspect MUST read, through a driver and changing nothing, the tables of a database with their columns (the type the engine reports, nullability, default), primary key, unique constraints, foreign keys (over more than one column too) and indexes, on SQLite, DuckDB and PostgreSQL, and MUST leave out the tables it is told to.
Enforced (check): .github: cd commons/data && bun run verify — suite/introspect.test.ts: a database made from a model is read back as what the model says: every table, column, nullability, primary key, foreign key, unique constraint and index, on each engine, and the drift from the model is none; suite/introspect.test.ts: composite keys, unique constraints, indexes, foreign keys over more than one column and defaults are read as they were written, on each engine
Proved by: data/suite/introspect.test.ts
Written in: data/sql/dialects/duckdb/observe.ts, data/sql/dialects/postgres/observe.ts, data/sql/dialects/sqlite/observe.ts, data/sql/lifecycle/introspect.ts
Tests: passed: suite/introspect.test.ts a database made from a model is read back as what the model says: every table, column, nul; passed: suite/introspect.test.ts composite keys, unique constraints, indexes, foreign keys over more than one column and de
Open: issue data 00012: Two readers of a database's catalog: convergence's `catalog` and the dialects' `observe`
Cited by: sql/physical/dialect