Trait mz_sql::catalog::CatalogItem

source ·
pub trait CatalogItem {
Show 24 methods // Required methods fn name(&self) -> &QualifiedItemName; fn id(&self) -> CatalogItemId; fn global_ids(&self) -> Box<dyn Iterator<Item = GlobalId> + '_>; fn oid(&self) -> u32; 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<CatalogItemId>; fn referenced_by(&self) -> &[CatalogItemId]; fn used_by(&self) -> &[CatalogItemId]; fn subsource_details( &self, ) -> Option<(CatalogItemId, &UnresolvedItemName, &SourceExportDetails)>; fn source_export_details( &self, ) -> Option<(CatalogItemId, &UnresolvedItemName, &SourceExportDetails, &SourceExportDataConfig<ReferencedConnection>)>; fn is_progress_source(&self) -> bool; fn progress_id(&self) -> Option<CatalogItemId>; fn index_details(&self) -> Option<(&[MirScalarExpr], GlobalId)>; fn writable_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>; fn at_version( &self, version: RelationVersionSelector, ) -> Box<dyn CatalogCollectionItem>;
}
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) -> CatalogItemId

Returns the CatalogItemId for the item.

source

fn global_ids(&self) -> Box<dyn Iterator<Item = GlobalId> + '_>

Returns the GlobalIds associated with this item.

source

fn oid(&self) -> u32

Returns the catalog item’s OID.

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<CatalogItemId>

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

source

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

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

source

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

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

source

fn subsource_details( &self, ) -> Option<(CatalogItemId, &UnresolvedItemName, &SourceExportDetails)>

Reports whether this catalog entry is a subsource and, if it is, the ingestion it is an export of, as well as the item it exports.

source

fn source_export_details( &self, ) -> Option<(CatalogItemId, &UnresolvedItemName, &SourceExportDetails, &SourceExportDataConfig<ReferencedConnection>)>

Reports whether this catalog entry is a source export and, if it is, the ingestion it is an export of, as well as the item it exports.

source

fn is_progress_source(&self) -> bool

Reports whether this catalog item is a progress source.

source

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

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 writable_table_details(&self) -> Option<&[Expr<Aug>]>

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

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.

source

fn at_version( &self, version: RelationVersionSelector, ) -> Box<dyn CatalogCollectionItem>

Returns the CatalogCollectionItem for a specific version of this CatalogItem.

Implementors§