pub enum CatalogQuery {
Show 29 variants
PgVersion,
Schemas,
Tables,
Columns,
Constraints,
Indexes,
Sequences,
Comments,
Dependencies,
ViewsAndMvs,
ViewColumns,
UserTypes,
EnumValues,
DomainDetails,
DomainChecks,
CompositeAttributes,
Functions,
Extensions,
Triggers,
PartitionedTables,
Partitions,
ClusterRoles,
ClusterMembers,
DefaultPrivileges,
Policies,
Publications,
PublicationRel,
PublicationNamespace,
PublicationAttributes,
}Expand description
Identifier for each catalog query the reader runs. Adapters dispatch on this enum to pick the per-version SQL string.
Variants§
PgVersion
SHOW server_version_num.
Schemas
pg_namespace rows for managed schemas.
Tables
pg_class (relkind=‘r’) for managed tables.
Columns
pg_attribute joined with pg_attrdef/pg_type for managed tables.
Constraints
pg_constraint for managed tables (PK/UNIQUE/FK/CHECK).
Indexes
pg_index for managed tables (excluding constraint-backing indexes).
Sequences
pg_class (relkind=‘S’) joined with pg_sequence.
Comments
pg_description (currently inlined into the per-object queries).
Dependencies
pg_depend rows linking sequences to their owning columns.
ViewsAndMvs
pg_class (relkind IN (‘v’,‘m’)) joined with pg_get_viewdef.
ViewColumns
pg_attribute for view and materialized view columns.
UserTypes
pg_type filtered to typtype IN ('e','d','c') for user-defined types.
EnumValues
pg_enum labels for enum types.
DomainDetails
Base-type and nullability details for domain types.
DomainChecks
Named CHECK constraints attached to domain types.
CompositeAttributes
Attributes (fields) of composite types.
Functions
pg_proc rows for functions and procedures (prokind IN ‘f’,‘p’).
Extensions
pg_extension rows for installed extensions.
Triggers
pg_trigger rows for user triggers (excluding internal + extension-owned).
PartitionedTables
pg_class (relkind=‘p’) rows for partitioned-table parents.
Partitions
pg_class (relispartition=true) rows for child partitions.
ClusterRoles
pg_authid rows for cluster roles (with pg_shdescription for comments).
Uses $1::text[] as the bootstrap-role filter (names to exclude), not a
managed-schema list. takes_text_array_param returns true so the adapter
passes the parameter; the cluster reader supplies bootstrap role names.
ClusterMembers
pg_auth_members edges joined to pg_authid for role names.
Same $1::text[] bootstrap-role filter as Self::ClusterRoles.
DefaultPrivileges
pg_default_acl rows joined to pg_authid and pg_namespace.
Returns one row per (target_role, schema, object_type) tuple. Rows for
predefined pg_* roles are filtered out. Takes no $1::text[]
parameter; takes_text_array_param returns false for this variant.
Policies
pg_policies rows for managed schemas.
Returns one row per policy, scoped to schemaname = ANY($1::text[]).
Decoded into crate::ir::policy::Policy and attached to their
owning Table by the assembler. Policies on unmanaged tables are
silently dropped.
Publications
pg_publication rows for all publications in the database.
Publications are database-global (not schema-scoped); takes no
$1::text[] parameter (takes_text_array_param returns false).
PublicationRel
pg_publication_rel rows — one per (publication, table) membership.
PG 15+ includes prqual (row filter) and prattrs (column list);
PG 14 variant substitutes NULL for both. Takes no parameter.
PublicationNamespace
pg_publication_namespace rows — one per (publication, schema)
membership (PG 15+ only). PG 14 variant returns zero rows.
Takes no parameter.
PublicationAttributes
pg_attribute rows for every column of every table referenced by
any publication. Used to resolve column attnums to names. Takes no
parameter.
Implementations§
Source§impl CatalogQuery
impl CatalogQuery
Sourcepub const fn takes_text_array_param(self) -> bool
pub const fn takes_text_array_param(self) -> bool
Whether this query accepts a $1::text[] argument.
The semantic meaning of the array varies by variant: managed-schema names for per-DB queries, bootstrap-role names for cluster queries. The adapter is responsible for passing the right slice to the right variant.
A few variants (PgVersion, Extensions) take no parameters at all;
this method returns false for those.
Trait Implementations§
Source§impl Clone for CatalogQuery
impl Clone for CatalogQuery
Source§fn clone(&self) -> CatalogQuery
fn clone(&self) -> CatalogQuery
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CatalogQuery
impl Debug for CatalogQuery
Source§impl Hash for CatalogQuery
impl Hash for CatalogQuery
Source§impl PartialEq for CatalogQuery
impl PartialEq for CatalogQuery
Source§fn eq(&self, other: &CatalogQuery) -> bool
fn eq(&self, other: &CatalogQuery) -> bool
self and other values to be equal, and is used by ==.impl Copy for CatalogQuery
impl Eq for CatalogQuery
impl StructuralPartialEq for CatalogQuery
Auto Trait Implementations§
impl Freeze for CatalogQuery
impl RefUnwindSafe for CatalogQuery
impl Send for CatalogQuery
impl Sync for CatalogQuery
impl Unpin for CatalogQuery
impl UnsafeUnpin for CatalogQuery
impl UnwindSafe for CatalogQuery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more