use crate::{IndexColumn, IndexColumnId, IndexWalker, SQLSortOrder, TableColumnWalker, TableWalker, Walker};
pub type IndexColumnWalker<'a> = Walker<'a, IndexColumnId>;
impl<'a> IndexColumnWalker<'a> {
pub fn get(self) -> &'a IndexColumn {
&self.schema.index_columns[self.id.0 as usize]
}
pub fn name(self) -> &'a str {
self.as_column().name()
}
pub fn length(self) -> Option<u32> {
self.get().length
}
pub fn sort_order(self) -> Option<SQLSortOrder> {
self.get().sort_order
}
pub fn table(self) -> TableWalker<'a> {
self.index().table()
}
pub fn index(self) -> IndexWalker<'a> {
self.walk(self.get().index_id)
}
pub fn as_column(self) -> TableColumnWalker<'a> {
self.walk(self.get().column_id)
}
}