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§
sourcefn name(&self) -> &QualifiedItemName
fn name(&self) -> &QualifiedItemName
Returns the fully qualified name of the catalog item.
sourcefn id(&self) -> CatalogItemId
fn id(&self) -> CatalogItemId
Returns the CatalogItemId
for the item.
sourcefn global_ids(&self) -> Box<dyn Iterator<Item = GlobalId> + '_>
fn global_ids(&self) -> Box<dyn Iterator<Item = GlobalId> + '_>
Returns the GlobalId
s associated with this item.
sourcefn func(&self) -> Result<&'static Func, CatalogError>
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.
sourcefn source_desc(
&self,
) -> Result<Option<&SourceDesc<ReferencedConnection>>, CatalogError>
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.
sourcefn connection(&self) -> Result<Connection<ReferencedConnection>, CatalogError>
fn connection(&self) -> Result<Connection<ReferencedConnection>, CatalogError>
Returns the resolved connection.
If the catalog item is not a connection, it returns an error.
sourcefn item_type(&self) -> CatalogItemType
fn item_type(&self) -> CatalogItemType
Returns the type of the catalog item.
sourcefn create_sql(&self) -> &str
fn create_sql(&self) -> &str
A normalized SQL statement that describes how to create the catalog item.
sourcefn references(&self) -> &ResolvedIds
fn references(&self) -> &ResolvedIds
Returns the IDs of the catalog items upon which this catalog item directly references.
sourcefn uses(&self) -> BTreeSet<CatalogItemId>
fn uses(&self) -> BTreeSet<CatalogItemId>
Returns the IDs of the catalog items upon which this catalog item depends.
sourcefn referenced_by(&self) -> &[CatalogItemId]
fn referenced_by(&self) -> &[CatalogItemId]
Returns the IDs of the catalog items that directly reference this catalog item.
sourcefn used_by(&self) -> &[CatalogItemId]
fn used_by(&self) -> &[CatalogItemId]
Returns the IDs of the catalog items that depend upon this catalog item.
sourcefn subsource_details(
&self,
) -> Option<(CatalogItemId, &UnresolvedItemName, &SourceExportDetails)>
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.
sourcefn source_export_details(
&self,
) -> Option<(CatalogItemId, &UnresolvedItemName, &SourceExportDetails, &SourceExportDataConfig<ReferencedConnection>)>
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.
sourcefn is_progress_source(&self) -> bool
fn is_progress_source(&self) -> bool
Reports whether this catalog item is a progress source.
sourcefn progress_id(&self) -> Option<CatalogItemId>
fn progress_id(&self) -> Option<CatalogItemId>
If this catalog item is a source, it return the IDs of its progress collection.
sourcefn index_details(&self) -> Option<(&[MirScalarExpr], GlobalId)>
fn index_details(&self) -> Option<(&[MirScalarExpr], GlobalId)>
Returns the index details associated with the catalog item, if the catalog item is an index.
sourcefn writable_table_details(&self) -> Option<&[Expr<Aug>]>
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.
sourcefn type_details(&self) -> Option<&CatalogTypeDetails<IdReference>>
fn type_details(&self) -> Option<&CatalogTypeDetails<IdReference>>
Returns the type information associated with the catalog item, if the catalog item is a type.
sourcefn privileges(&self) -> &PrivilegeMap
fn privileges(&self) -> &PrivilegeMap
Returns the privileges associated with the item.
sourcefn cluster_id(&self) -> Option<ClusterId>
fn cluster_id(&self) -> Option<ClusterId>
Returns the cluster the item belongs to.
sourcefn at_version(
&self,
version: RelationVersionSelector,
) -> Box<dyn CatalogCollectionItem>
fn at_version( &self, version: RelationVersionSelector, ) -> Box<dyn CatalogCollectionItem>
Returns the CatalogCollectionItem
for a specific version of this
CatalogItem
.