Type Alias sql_schema_describer::walkers::TableWalker
source · pub type TableWalker<'a> = Walker<'a, TableId>;
Expand description
Traverse a table.
Aliased Type§
struct TableWalker<'a> {
pub id: TableId,
pub schema: &'a SqlSchema,
}
Fields§
§id: TableId
The identifier.
schema: &'a SqlSchema
The schema for which the identifier is valid.
Implementations§
source§impl<'a> TableWalker<'a>
impl<'a> TableWalker<'a>
sourcepub fn column(self, column_name: &str) -> Option<TableColumnWalker<'a>>
pub fn column(self, column_name: &str) -> Option<TableColumnWalker<'a>>
Get a column in the table, by name.
sourcepub fn columns(self) -> impl ExactSizeIterator<Item = TableColumnWalker<'a>>
pub fn columns(self) -> impl ExactSizeIterator<Item = TableColumnWalker<'a>>
Traverse the table’s columns.
sourcepub fn foreign_key_count(self) -> usize
pub fn foreign_key_count(self) -> usize
The number of foreign key constraints on the table.
sourcepub fn indexes(self) -> impl ExactSizeIterator<Item = IndexWalker<'a>>
pub fn indexes(self) -> impl ExactSizeIterator<Item = IndexWalker<'a>>
Traverse the indexes on the table.
sourcepub fn foreign_keys(self) -> impl ExactSizeIterator<Item = ForeignKeyWalker<'a>>
pub fn foreign_keys(self) -> impl ExactSizeIterator<Item = ForeignKeyWalker<'a>>
Traverse the foreign keys on the table.
sourcepub fn referencing_foreign_keys(
self
) -> impl Iterator<Item = ForeignKeyWalker<'a>>
pub fn referencing_foreign_keys( self ) -> impl Iterator<Item = ForeignKeyWalker<'a>>
Traverse foreign keys from other tables, referencing current table.
sourcepub fn foreign_key_for_column(
self,
column: TableColumnId
) -> Option<ForeignKeyWalker<'a>>
pub fn foreign_key_for_column( self, column: TableColumnId ) -> Option<ForeignKeyWalker<'a>>
Try to traverse a foreign key for a single column.
sourcepub fn namespace_id(self) -> NamespaceId
pub fn namespace_id(self) -> NamespaceId
The namespace the table belongs to.
sourcepub fn primary_key(self) -> Option<IndexWalker<'a>>
pub fn primary_key(self) -> Option<IndexWalker<'a>>
Traverse to the primary key of the table.
sourcepub fn primary_key_columns(
self
) -> Option<impl ExactSizeIterator<Item = IndexColumnWalker<'a>>>
pub fn primary_key_columns( self ) -> Option<impl ExactSizeIterator<Item = IndexColumnWalker<'a>>>
The columns that are part of the primary keys.
sourcepub fn primary_key_columns_count(self) -> usize
pub fn primary_key_columns_count(self) -> usize
How many columns are in the primary key? Returns 0 in the absence of a pk.
sourcepub fn is_partition(self) -> bool
pub fn is_partition(self) -> bool
Is the table a partition table?
sourcepub fn has_subclass(self) -> bool
pub fn has_subclass(self) -> bool
Does the table have subclasses?
sourcepub fn has_row_level_security(self) -> bool
pub fn has_row_level_security(self) -> bool
Does the table have row level security enabled?
sourcepub fn has_check_constraints(self) -> bool
pub fn has_check_constraints(self) -> bool
Does the table have check constraints?
sourcepub fn check_constraints(self) -> impl ExactSizeIterator<Item = &'a str>
pub fn check_constraints(self) -> impl ExactSizeIterator<Item = &'a str>
The check constraint names for the table.
sourcepub fn description(self) -> Option<&'a str>
pub fn description(self) -> Option<&'a str>
Description (comment) of the table.