Skip to main content

CatalogQuery

Enum CatalogQuery 

Source
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

Source

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

Source§

fn clone(&self) -> CatalogQuery

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CatalogQuery

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for CatalogQuery

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for CatalogQuery

Source§

fn eq(&self, other: &CatalogQuery) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for CatalogQuery

Source§

impl Eq for CatalogQuery

Source§

impl StructuralPartialEq for CatalogQuery

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.