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>

source

pub fn column(self, column_name: &str) -> Option<TableColumnWalker<'a>>

Get a column in the table, by name.

source

pub fn columns(self) -> impl ExactSizeIterator<Item = TableColumnWalker<'a>>

Traverse the table’s columns.

source

pub fn foreign_key_count(self) -> usize

The number of foreign key constraints on the table.

source

pub fn indexes(self) -> impl ExactSizeIterator<Item = IndexWalker<'a>>

Traverse the indexes on the table.

source

pub fn foreign_keys(self) -> impl ExactSizeIterator<Item = ForeignKeyWalker<'a>>

Traverse the foreign keys on the table.

source

pub fn referencing_foreign_keys( self ) -> impl Iterator<Item = ForeignKeyWalker<'a>>

Traverse foreign keys from other tables, referencing current table.

source

pub fn name(self) -> &'a str

The table name.

source

pub fn foreign_key_for_column( self, column: TableColumnId ) -> Option<ForeignKeyWalker<'a>>

Try to traverse a foreign key for a single column.

source

pub fn namespace(self) -> Option<&'a str>

The namespace the table belongs to, if defined.

source

pub fn namespace_id(self) -> NamespaceId

The namespace the table belongs to.

source

pub fn primary_key(self) -> Option<IndexWalker<'a>>

Traverse to the primary key of the table.

source

pub fn primary_key_columns( self ) -> Option<impl ExactSizeIterator<Item = IndexColumnWalker<'a>>>

The columns that are part of the primary keys.

source

pub fn primary_key_columns_count(self) -> usize

How many columns are in the primary key? Returns 0 in the absence of a pk.

source

pub fn is_partition(self) -> bool

Is the table a partition table?

source

pub fn has_subclass(self) -> bool

Does the table have subclasses?

source

pub fn has_row_level_security(self) -> bool

Does the table have row level security enabled?

source

pub fn has_check_constraints(self) -> bool

Does the table have check constraints?

source

pub fn check_constraints(self) -> impl ExactSizeIterator<Item = &'a str>

The check constraint names for the table.

source

pub fn description(self) -> Option<&'a str>

Description (comment) of the table.