Type Alias sql_schema_describer::walkers::ColumnWalker
source · pub type ColumnWalker<'a> = Walker<'a, Either<TableColumnId, ViewColumnId>>;
Expand description
Traverse a column, that can be in a table or in a view.
Aliased Type§
struct ColumnWalker<'a> {
pub id: Either<TableColumnId, ViewColumnId>,
pub schema: &'a SqlSchema,
}
Fields§
§id: Either<TableColumnId, ViewColumnId>
The identifier.
schema: &'a SqlSchema
The schema for which the identifier is valid.
Implementations§
source§impl<'a> ColumnWalker<'a>
impl<'a> ColumnWalker<'a>
sourcepub fn refine(self) -> Either<TableColumnWalker<'a>, ViewColumnWalker<'a>> ⓘ
pub fn refine(self) -> Either<TableColumnWalker<'a>, ViewColumnWalker<'a>> ⓘ
Refines the walker to either as a table or as a view column.
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 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 default(self) -> Option<DefaultValueWalker<'a>>
pub fn default(self) -> Option<DefaultValueWalker<'a>>
the default value for the column.
sourcepub fn is_same_column(self, other: ColumnWalker<'_>) -> bool
pub fn is_same_column(self, other: ColumnWalker<'_>) -> bool
returns whether two columns are named the same and belong to the same table.
sourcepub fn is_in_view(self) -> bool
pub fn is_in_view(self) -> bool
True if the column is defined in a view.
sourcepub fn description(self) -> Option<&'a str>
pub fn description(self) -> Option<&'a str>
Description (comment) of the column.