Type Alias sql_schema_describer::walkers::DefaultValueWalker
source · pub type DefaultValueWalker<'a> = Walker<'a, Either<TableDefaultValueId, ViewDefaultValueId>>;
Expand description
Traverse default value.
Aliased Type§
struct DefaultValueWalker<'a> {
pub id: Either<TableDefaultValueId, ViewDefaultValueId>,
pub schema: &'a SqlSchema,
}
Fields§
§id: Either<TableDefaultValueId, ViewDefaultValueId>
The identifier.
schema: &'a SqlSchema
The schema for which the identifier is valid.
Implementations§
source§impl<'a> DefaultValueWalker<'a>
impl<'a> DefaultValueWalker<'a>
sourcepub fn refine(
self
) -> Either<TableDefaultValueWalker<'a>, ViewDefaultValueWalker<'a>> ⓘ
pub fn refine( self ) -> Either<TableDefaultValueWalker<'a>, ViewDefaultValueWalker<'a>> ⓘ
Refines the walker to either as a table or as a view column default.
sourcepub fn as_value(self) -> Option<&'a PrismaValue>
pub fn as_value(self) -> Option<&'a PrismaValue>
Return a value if a constant.
sourcepub fn as_sequence(self) -> Option<&'a str>
pub fn as_sequence(self) -> Option<&'a str>
If the value is a squence, return it
sourcepub fn is_sequence(&self) -> bool
pub fn is_sequence(&self) -> bool
True if referencing a sequence
sourcepub fn is_db_generated(&self) -> bool
pub fn is_db_generated(&self) -> bool
True if value generation is handled in the database
sourcepub fn kind(self) -> &'a DefaultKind
pub fn kind(self) -> &'a DefaultKind
The value kind enumerator
sourcepub fn constraint_name(self) -> Option<&'a str>
pub fn constraint_name(self) -> Option<&'a str>
The name of the default value constraint.
sourcepub fn value(self) -> &'a DefaultValue
pub fn value(self) -> &'a DefaultValue
The default value data