Type Alias sql_schema_describer::walkers::IndexWalker
source · pub type IndexWalker<'a> = Walker<'a, IndexId>;
Expand description
Traverse an index.
Aliased Type§
struct IndexWalker<'a> {
pub id: IndexId,
pub schema: &'a SqlSchema,
}
Fields§
§id: IndexId
The identifier.
schema: &'a SqlSchema
The schema for which the identifier is valid.
Implementations§
source§impl<'a> IndexWalker<'a>
impl<'a> IndexWalker<'a>
sourcepub fn column_names(self) -> impl ExactSizeIterator<Item = &'a str>
pub fn column_names(self) -> impl ExactSizeIterator<Item = &'a str>
The names of the indexed columns.
sourcepub fn columns(self) -> impl ExactSizeIterator<Item = IndexColumnWalker<'a>>
pub fn columns(self) -> impl ExactSizeIterator<Item = IndexColumnWalker<'a>>
Traverse the indexed columns.
sourcepub fn contains_column(self, column_id: TableColumnId) -> bool
pub fn contains_column(self, column_id: TableColumnId) -> bool
True if index contains the given column.
sourcepub fn index_type(self) -> IndexType
pub fn index_type(self) -> IndexType
The IndexType
sourcepub fn is_primary_key(self) -> bool
pub fn is_primary_key(self) -> bool
Is this index the primary key of the table?
sourcepub fn is_unique(self) -> bool
pub fn is_unique(self) -> bool
Is this index a unique constraint? NB: This will return false
for the primary key.
sourcepub fn table(self) -> TableWalker<'a>
pub fn table(self) -> TableWalker<'a>
Traverse to the table of the index.