Documentation
¶
Overview ¶
Package introspect reads a live Postgres schema into rig's intermediate representation.
This is the only impure stage of the pipeline. Everything downstream is a pure function of what comes out of here, which is why Read returns a value rather than holding a connection: the rest of the compiler runs from a JSON dump with no database in sight.
Queries go to pg_catalog rather than information_schema. The catalog is less portable and less pleasant to read, but it exposes things the standard views hide — index methods, partial predicates, generated-column kinds, enum sort order — and rig needs all of them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Read ¶
Read introspects a schema.
The result is unsorted and unlinked: it says what the database contains and nothing more. Canonicalizing it — ordering, resolving enum types onto columns, classifying join tables — is [compile.Normalize]'s job, so that the same normalization applies whether the schema came from a database or from a file.