Type Alias sql_schema_describer::walkers::TableColumnWalker
source · pub type TableColumnWalker<'a> = Walker<'a, TableColumnId>;
Expand description
Traverse a table column.
Aliased Type§
struct TableColumnWalker<'a> {
pub id: TableColumnId,
pub schema: &'a SqlSchema,
}
Fields§
§id: TableColumnId
The identifier.
schema: &'a SqlSchema
The schema for which the identifier is valid.
Implementations§
source§impl<'a> TableColumnWalker<'a>
impl<'a> TableColumnWalker<'a>
sourcepub fn coarsen(self) -> ColumnWalker<'a>
pub fn coarsen(self) -> ColumnWalker<'a>
Coarsen the walker into a generic column version.
sourcepub fn arity(self) -> ColumnArity
pub fn arity(self) -> ColumnArity
The nullability and arity of the column.
sourcepub fn column_has_enum_default_value(self, enum_name: &str, value: &str) -> bool
pub fn column_has_enum_default_value(self, enum_name: &str, value: &str) -> bool
Returns whether the column has the enum default value of the given enum type.
sourcepub fn column_type_is_enum(self, enum_name: &str) -> bool
pub fn column_type_is_enum(self, enum_name: &str) -> bool
Returns whether the type of the column matches the provided enum name.
sourcepub fn column_type_family(self) -> &'a ColumnTypeFamily
pub fn column_type_family(self) -> &'a ColumnTypeFamily
The type family.
sourcepub fn column_type_family_as_enum(self) -> Option<EnumWalker<'a>>
pub fn column_type_family_as_enum(self) -> Option<EnumWalker<'a>>
Extract an Enum
column type family, or None
if the family is something else.
sourcepub fn default(self) -> Option<TableDefaultValueWalker<'a>>
pub fn default(self) -> Option<TableDefaultValueWalker<'a>>
the default value for the column.
sourcepub fn column_type(self) -> &'a ColumnType
pub fn column_type(self) -> &'a ColumnType
The full column type.
sourcepub fn column_native_type<T: Any + 'static>(self) -> Option<&'a T>
pub fn column_native_type<T: Any + 'static>(self) -> Option<&'a T>
The column native type.
sourcepub fn is_autoincrement(self) -> bool
pub fn is_autoincrement(self) -> bool
Is this column an auto-incrementing integer?
sourcepub fn is_same_column(self, other: TableColumnWalker<'_>) -> bool
pub fn is_same_column(self, other: TableColumnWalker<'_>) -> bool
Returns whether two columns are named the same and belong to the same table.
sourcepub fn is_part_of_secondary_index(self) -> bool
pub fn is_part_of_secondary_index(self) -> bool
Is this column indexed by a secondary index??
sourcepub fn is_part_of_primary_key(self) -> bool
pub fn is_part_of_primary_key(self) -> bool
Is this column a part of the table’s primary key?
sourcepub fn is_part_of_foreign_key(self) -> bool
pub fn is_part_of_foreign_key(self) -> bool
Is this column a part of one of the table’s foreign keys?
sourcepub fn is_single_primary_key(self) -> bool
pub fn is_single_primary_key(self) -> bool
Returns whether this column is the primary key. If it is only part of the primary key, this will return false.
sourcepub fn table(self) -> TableWalker<'a>
pub fn table(self) -> TableWalker<'a>
Traverse to the column’s table.