Trait sql::catalog::CatalogItem [−][src]
pub trait CatalogItem {
fn name(&self) -> &FullName;
fn id(&self) -> GlobalId;
fn oid(&self) -> u32;
fn desc(&self) -> Result<&RelationDesc, CatalogError>;
fn func(&self) -> Result<&'static Func, CatalogError>;
fn source_connector(&self) -> Result<&SourceConnector, CatalogError>;
fn item_type(&self) -> CatalogItemType;
fn create_sql(&self) -> &str;
fn uses(&self) -> &[GlobalId]ⓘ;
fn used_by(&self) -> &[GlobalId]ⓘ;
fn index_details(&self) -> Option<(&[MirScalarExpr], GlobalId)>;
fn table_details(&self) -> Option<&[Expr<Raw>]>;
}
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
fn desc(&self) -> Result<&RelationDesc, CatalogError>
fn desc(&self) -> Result<&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.
fn 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.
fn source_connector(&self) -> Result<&SourceConnector, CatalogError>
fn source_connector(&self) -> Result<&SourceConnector, CatalogError>
Returns the resolved source connector.
If the catalog item is not of a type that contains a SourceConnector
(i.e., anything other than sources), it returns an error.
fn item_type(&self) -> CatalogItemType
fn item_type(&self) -> CatalogItemType
Returns the type of the catalog item.
fn create_sql(&self) -> &str
fn create_sql(&self) -> &str
A normalized SQL statement that describes how to create the catalog item.
Returns the IDs of the catalog items upon which this catalog item depends.
Returns the IDs of the catalog items that depend upon this catalog item.
fn 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.