Skip to main content

Module introspect

Module introspect 

Source
Expand description

Schema introspection queries against pg_catalog.

information_schema is portable but slow on large databases (the views join across many tables and filter by privilege). pg_catalog is direct, orders of magnitude faster, and exposes the metadata Postgres tooling actually needs (relkind, oids, persistence). All queries are parameter-less SELECTs to keep the surface boring and review-able.

Structs§

ColumnDetail
Per-column metadata used by the INSERT form to pre-set Use DEFAULT and NULL toggles. Read from pg_attribute joined with pg_attrdef for the default-presence flag.
DbSummary
ObjectType
Relation
Routine
SchemaContents
Unified schema-contents view used by the tree’s “expand a schema” path. Six-way grouping mirrors DataGrip’s tree. Tables include regular, partitioned, and foreign tables (all “data-bearing relations”); views and materialized views split out for clarity.
SchemaSummary
Sequence

Enums§

ObjectTypeKind
RelationKind
Discriminator for tables / views / matviews / partitioned tables / foreign tables. Matches pg_class.relkind values that an explorer cares about. Sequences, indexes, composite types, and TOAST relations are excluded from list_relations and so do not appear here.
RoutineKind

Functions§

describe_columns
list_databases
list_object_types
list_relations
list_routines
list_schema_contents
Concurrent fetch of all schema contents in one logical call. tokio_postgres::Client pipelines so the four queries overlap on the wire — total latency is roughly max(query_latency) rather than 4× a single query.
list_schemas
list_sequences