pub trait CatalogItem {
Show 23 methods // Required methods fn name(&self) -> &QualifiedItemName; fn id(&self) -> GlobalId; fn oid(&self) -> u32; fn desc( &self, name: &FullItemName ) -> Result<Cow<'_, RelationDesc>, CatalogError>; fn func(&self) -> Result<&'static Func, CatalogError>; fn source_desc( &self ) -> Result<Option<&SourceDesc<ReferencedConnection>>, CatalogError>; fn connection( &self ) -> Result<&Connection<ReferencedConnection>, CatalogError>; fn item_type(&self) -> CatalogItemType; fn create_sql(&self) -> &str; fn references(&self) -> &ResolvedIds; fn uses(&self) -> BTreeSet<GlobalId>; fn referenced_by(&self) -> &[GlobalId]; fn used_by(&self) -> &[GlobalId]; fn is_subsource(&self) -> bool; fn is_progress_source(&self) -> bool; fn subsources(&self) -> BTreeSet<GlobalId>; fn progress_id(&self) -> Option<GlobalId>; fn index_details(&self) -> Option<(&[MirScalarExpr], GlobalId)>; fn table_details(&self) -> Option<&[Expr<Aug>]>; fn type_details(&self) -> Option<&CatalogTypeDetails<IdReference>>; fn owner_id(&self) -> RoleId; fn privileges(&self) -> &PrivilegeMap; fn cluster_id(&self) -> Option<ClusterId>;
}
Expand description

An item in a SessionCatalog.

Note that “item” has a very specific meaning in the context of a SQL catalog, and refers to the various entities that belong to a schema.

Required Methods§

source

fn name(&self) -> &QualifiedItemName

Returns the fully qualified name of the catalog item.

source

fn id(&self) -> GlobalId

Returns a stable ID for the catalog item.

source

fn oid(&self) -> u32

Returns the catalog item’s OID.

source

fn desc( &self, name: &FullItemName ) -> Result<Cow<'_, RelationDesc>, CatalogError>

Returns a description of the result set produced by the catalog item.

If the catalog item is not of a type that produces data (i.e., a sink or an index), it returns an error.

source

fn func(&self) -> Result<&'static Func, CatalogError>

Returns the resolved function.

If the catalog item is not of a type that produces functions (i.e., anything other than a function), it returns an error.

source

fn source_desc( &self ) -> Result<Option<&SourceDesc<ReferencedConnection>>, CatalogError>

Returns the resolved source connection.

If the catalog item is not of a type that contains a SourceDesc (i.e., anything other than sources), it returns an error.

source

fn connection(&self) -> Result<&Connection<ReferencedConnection>, CatalogError>

Returns the resolved connection.

If the catalog item is not a connection, it returns an error.

source

fn item_type(&self) -> CatalogItemType

Returns the type of the catalog item.

source

fn create_sql(&self) -> &str

A normalized SQL statement that describes how to create the catalog item.

source

fn references(&self) -> &ResolvedIds

Returns the IDs of the catalog items upon which this catalog item directly references.

source

fn uses(&self) -> BTreeSet<GlobalId>

Returns the IDs of the catalog items upon which this catalog item depends.

source

fn referenced_by(&self) -> &[GlobalId]

Returns the IDs of the catalog items that directly reference this catalog item.

source

fn used_by(&self) -> &[GlobalId]

Returns the IDs of the catalog items that depend upon this catalog item.

source

fn is_subsource(&self) -> bool

Reports whether this catalog item is a subsource.

source

fn is_progress_source(&self) -> bool

Reports whether this catalog item is a progress source.

source

fn subsources(&self) -> BTreeSet<GlobalId>

If this catalog item is a source, it return the IDs of its subsources.

source

fn progress_id(&self) -> Option<GlobalId>

If this catalog item is a source, it return the IDs of its progress collection.

source

fn index_details(&self) -> Option<(&[MirScalarExpr], GlobalId)>

Returns the index details associated with the catalog item, if the catalog item is an index.

source

fn table_details(&self) -> Option<&[Expr<Aug>]>

Returns the column defaults associated with the catalog item, if the catalog item is a table.

source

fn type_details(&self) -> Option<&CatalogTypeDetails<IdReference>>

Returns the type information associated with the catalog item, if the catalog item is a type.

source

fn owner_id(&self) -> RoleId

Returns the ID of the owning role.

source

fn privileges(&self) -> &PrivilegeMap

Returns the privileges associated with the item.

source

fn cluster_id(&self) -> Option<ClusterId>

Returns the cluster the item belongs to.

Implementors§