GeneratedColumnWithTypeConverter<D, S extends Object> class
A GeneratedColumn with a type converter attached to it.
This provides the equalsValue method, which can be used to compare this column against a value mapped through a type converter.
- Inheritance
-
- Object
- Expression<
S> - Column<
S> - GeneratedColumn<
S> - GeneratedColumnWithTypeConverter
- Available Extensions
Properties
- $customConstraints → String?
-
Custom constraints that have been specified for this column.
finalinherited
- $name → String
-
The sql name of this column.
finalinherited
- $nullable → bool
-
Whether null values are allowed for this column.
finalinherited
- additionalChecks → (VerificationResult Function(S?, VerificationMeta)?)
-
Additional checks performed on values before inserts or updates.
finalinherited
-
check
→ (Expression<
bool> Function()?) -
A
CHECK
column constraint present on this column.finalinherited - clientDefault → (S? Function()?)
-
A function that yields a default column for inserts if no value has been
set. This is different to defaultValue since the function is written in
Dart, not SQL. It's a compile-time error to declare columns where both
defaultValue and clientDefault are non-null.
finalinherited
-
converter
→ TypeConverter<
D, S?> -
The type converted used on this column.
final
-
defaultValue
→ Expression<
S> ? -
The default expression to be used during inserts when no value has been
specified. Can be null if no default value is set.
finalinherited
-
driftSqlType
→ DriftSqlType<
S> -
The supported DriftSqlType backing this expression.
read-onlyinherited
- escapedName → String
-
name, but wrapped in double quotes to escape it as a a same identifier.
read-onlyinherited
- generatedAs → GeneratedAs?
-
If this column is generated (that is, it is a SQL expression of other)
columns, contains information about how to generate this column.
finalinherited
- hasAutoIncrement → bool
-
Whether this column has an
AUTOINCREMENT
primary key constraint that was created by drift.finalinherited - hashCode → int
-
The hash code for this object.
read-onlyinherited
- isLiteral → bool
-
Whether this expression is a literal. Some use-sites need to put
parentheses around non-literals.
read-onlyinherited
- name → String
-
The (unescaped) name of this column.
read-onlyinherited
- precedence → Precedence
-
The precedence of this expression. This can be used to automatically put
parentheses around expressions as needed.
finalinherited
- requiredDuringInsert → bool
-
Whether a value is required for this column when inserting a new row.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- tableName → String
-
The name of the table that contains this column
finalinherited
-
type
→ DriftSqlType<
S> -
The sql type to use for this column.
finalinherited
Methods
-
caseMatch<
T extends Object> ({required Map< Expression< when, Expression<S> , Expression<T> >T> ? orElse}) → Expression<T> -
A
CASE WHEN
construct using the current expression as a base.inherited -
cast<
D2 extends Object> () → Expression< D2> -
Generates a
CAST(expression AS TYPE)
expression.inherited -
dartCast<
D2 extends Object> () → Expression< D2> -
Casts this expression to an expression of
D
.inherited -
equals(
S compare) → Expression< bool> -
Whether this column is equal to the given value, which must have a fitting
type. The
compare
value will be written as a variable using prepared statements, so there is no risk of an SQL-injection.inherited -
equalsExp(
Expression< S> compare) → Expression<bool> -
Whether this expression is equal to the given expression.
inherited
-
equalsNullable(
S? compare) → Expression< bool> -
Compares the value of this column to
compare
ornull
.inherited -
equalsValue(
D? dartValue) → Expression< bool> -
Compares this column against the mapped
dartValue
. -
iif<
T extends Object> (Expression< bool> predicate, Expression<T> ifFalse) → Expression<T> -
Evaluates to
this
ifpredicate
is true, otherwise evaluates toifFalse
.inherited -
isAcceptableOrUnknown(
Expression< Object> value, VerificationMeta meta) → VerificationResult -
A more general version of isAcceptableValue that supports any sql
expression.
inherited
-
isAcceptableValue(
S? value, VerificationMeta meta) → VerificationResult -
Checks whether the given value fits into this column. The default
implementation only checks for nullability, but subclasses might enforce
additional checks. For instance, a text column might verify that a text
has a certain length.
inherited
-
isExp(
Expression< S> other) → Expression<bool> -
Generates an
IS
expression in SQL, comparing this expression with theother
expression.inherited -
isIn(
Iterable< S> values) → Expression<bool> -
An expression that is true if
this
resolves to any of the values invalues
.inherited -
isInQuery(
BaseSelectStatement select) → Expression< bool> -
An expression checking whether
this
is included in any row of the providedselect
statement.inherited -
isInValues(
Iterable< D> values) → Expression<bool> -
An expression that is true if
this
resolves to any of the values invalues
. -
isNotExp(
Expression< S> other) → Expression<bool> -
Generates an
IS NOT
expression in SQL, comparing this expression with theother
expression.inherited -
isNotIn(
Iterable< S> values) → Expression<bool> -
An expression that is true if
this
does not resolve to any of the values invalues
.inherited -
isNotInQuery(
BaseSelectStatement select) → Expression< bool> -
An expression checking whether
this
is not included in any row of the providedselect
statement.inherited -
isNotInValues(
Iterable< D> values) → Expression<bool> -
An expression that is true if
this
does not resolve to any of the values invalues
. -
isNotNull(
) → Expression< bool> -
Expression that is true if the inner expression resolves to a non-null
value.
inherited
-
isNotValue(
S value) → Expression< bool> -
Generates an
IS NOT
expression in SQL, comparing this expression with the Dartvalue
.inherited -
isNull(
) → Expression< bool> -
Expression that is true if the inner expression resolves to a null value.
inherited
-
isValue(
S value) → Expression< bool> -
Generates an
IS
expression in SQL, comparing this expression with the Dartvalue
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
nullIf(
Expression< S> matcher) → Expression<S> -
Returns
null
ifmatcher
is equal to this expression,this
otherwise.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
withConverter<
D> (TypeConverter< D, S?> converter) → GeneratedColumnWithTypeConverter<D, S> -
Applies a type converter to this column.
inherited
-
writeAroundPrecedence(
GenerationContext context, Precedence precedence) → void -
Writes this expression into the GenerationContext, assuming that there's
an outer expression with
precedence
. If the Expression.precedence ofthis
expression is lower, it will be wrap}ped ininherited -
writeColumnDefinition(
GenerationContext into) → void -
Writes the definition of this column, as defined
here, into the given
buffer.
inherited
-
writeInner(
GenerationContext ctx, Expression< Object> inner) → void -
If this Expression wraps an
inner
expression, this utility method can be used inside writeInto to write that inner expression while wrapping it in parentheses if necessary.inherited -
writeInto(
GenerationContext context, {bool ignoreEscape = false}) → void -
Writes this component into the
context
by writing to its GenerationContext.buffer or by introducing bound variables. When writing into the buffer, no whitespace around the this component should be introduced. When a component consists of multiple composed component, it's responsible for introducing whitespace between its child components.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited