mz_sql::catalog

Trait CatalogItem

Source
pub trait CatalogItem {
Show 25 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>; fn latest_version(&self) -> Option<RelationVersion>;
}
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.

Source

fn latest_version(&self) -> Option<RelationVersion>

The latest version of this item, if it’s version-able.

Implementors§