Documentation
¶
Overview ¶
Package introspect builds an IR Catalog by querying a live PostgreSQL instance through pg_catalog. The produced *irv1.Catalog has the same shape as the one internal/catalog.Build produces from parsed DDL, so the diff engine can compare a parsed (desired) catalog against an introspected (actual) one.
Object ids follow the same convention as internal/catalog: "schema.name" for schema-scoped objects, "schema.table.column" for columns, and "schema.table.constraint" for constraints. Expressions (defaults, check bodies, index predicates, generated columns) are captured verbatim as the Expr raw_sql escape hatch via pg_get_expr / pg_get_constraintdef / pg_get_indexdef, mirroring how the diff compares text.
The introspector never panics: types it cannot classify fall back to a best-effort TypeRef{PgName: ...}; rows that fail to scan are skipped.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Introspect ¶
Introspect builds an *irv1.Catalog from a live PostgreSQL connection, restricted to the given schemas. When schemas is empty it defaults to "public" plus every non-system, non-temp schema. It never panics.