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>

source

pub fn refine( self ) -> Either<TableDefaultValueWalker<'a>, ViewDefaultValueWalker<'a>>

Refines the walker to either as a table or as a view column default.

source

pub fn as_value(self) -> Option<&'a PrismaValue>

Return a value if a constant.

source

pub fn as_sequence(self) -> Option<&'a str>

If the value is a squence, return it

source

pub fn is_value(&self) -> bool

True if a constant value

source

pub fn is_now(&self) -> bool

True if now()

source

pub fn is_sequence(&self) -> bool

True if referencing a sequence

source

pub fn is_db_generated(&self) -> bool

True if value generation is handled in the database

source

pub fn kind(self) -> &'a DefaultKind

The value kind enumerator

source

pub fn constraint_name(self) -> Option<&'a str>

The name of the default value constraint.

source

pub fn value(self) -> &'a DefaultValue

The default value data