Updated
On this page
Package introspect provides live PostgreSQL database introspection, extracting schema information from pg_catalog into the resolved IR model.
#internal/introspect
#internal/introspect
Package introspect provides live PostgreSQL database introspection, extracting schema information from pg_catalog into the resolved IR model.
#Export
go
func Export(schema *model.Schema) ([]byte, error)Export serializes a model.Schema to pgdesign TOML format using go-toml-edit AST building. The output is produced by Format for consistent formatting.
#Introspect
go
func Introspect(ctx context.Context, connStr string, schemaNames []string) (*model.Schema, []diagnostic.Diagnostic, error)Introspect connects to a PostgreSQL database, extracts schema information for the given schema names, and returns a unified model.Schema. The provided context controls connection and query timeouts.