GeneratedColumnWithTypeConverter<D, S> 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
CHECKcolumn 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
-
date
→ Expression<
String?> -
Available on Expression<
Formats this datetime in the formatDateTime?> , provided by the DateTimeExpressions extensionyear-month-day.no setter -
day
→ Expression<
int?> -
Available on Expression<
Extracts the (UTC) day fromDateTime?> , provided by the DateTimeExpressions extensionthisdatetime expression.no setter -
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
- escapedName → String
-
name, but escaped if it's an sql keyword.
no setterinherited
- 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
AUTOINCREMENTprimary key constraint that was created by drift.no setterinherited - hashCode → int
-
The hash code for this object.
no setterinherited
-
hour
→ Expression<
int?> -
Available on Expression<
Extracts the (UTC) hour fromDateTime?> , provided by the DateTimeExpressions extensionthisdatetime expression.no setter - isLiteral → bool
-
Whether this expression is a literal. Some use-sites need to put
parentheses around non-literals.
no setterinherited
-
length
→ Expression<
int?> -
Available on Expression<
Calls the sqlite functionString?> , provided by the StringExpressionOperators extensionLENGTHonthisstring, which counts the number of characters in this string. Note that, in most sqlite installations, length may not support all unicode rules.no setter -
minute
→ Expression<
int?> -
Available on Expression<
Extracts the (UTC) minute fromDateTime?> , provided by the DateTimeExpressions extensionthisdatetime expression.no setter -
month
→ Expression<
int?> -
Available on Expression<
Extracts the (UTC) month fromDateTime?> , provided by the DateTimeExpressions extensionthisdatetime expression.no setter - name → String
-
The (unescaped) name of this column.
no setterinherited
- 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.
no setterinherited
-
second
→ Expression<
int?> -
Available on Expression<
Extracts the (UTC) second fromDateTime?> , provided by the DateTimeExpressions extensionthisdatetime expression.no setter -
secondsSinceEpoch
→ Expression<
int> -
Available on Expression<
Returns an expression containing the amount of seconds from the unix epoch (January 1st, 1970) toDateTime?> , provided by the DateTimeExpressions extensionthisdatetime expression. The datetime is assumed to be in utc.no setter - tableName → String
-
The name of the table that contains this column
finalinherited
- type → SqlType
-
The sql type, such as
StringTypefor texts.finalinherited - typeName → String
-
The sql type name, such as
TEXTfor texts.no setterinherited -
year
→ Expression<
int?> -
Available on Expression<
Extracts the (UTC) year fromDateTime?> , provided by the DateTimeExpressions extensionthisdatetime expression.no setter
Methods
-
abs(
) → Expression< DT> -
Available on Expression<
Calculates the absolute value of this number.DT> , provided by the ArithmeticBigIntExpr extension -
abs(
) → Expression< DT> -
Available on Expression<
Calculates the absolute value of this number.DT> , provided by the ArithmeticExpr extension -
avg(
{Expression< bool?> ? filter}) → Expression<DateTime> -
Available on Expression<
Return the average of all non-null values in this group. To only consider rows matching a predicate, you can set the optionalDateTime?> , provided by the DateTimeAggregate extensionfilter. Note thatfilteris only available from sqlite 3.30, released on 2019-10-04. Most devices will use an older sqlite version. -
avg(
{Expression< bool?> ? filter}) → Expression<double?> -
Available on Expression<
Return the average of all non-null values in this group.DT?> , provided by the ArithmeticAggregates extension -
avg(
{Expression< bool?> ? filter}) → Expression<double?> -
Available on Expression<
Return the average of all non-null values in this group.DT?> , provided by the BigIntAggregates extension -
caseMatch<
T> ({required Map< Expression< when, Expression<S> , Expression<T?> >T?> ? orElse}) → Expression<T?> -
A
CASE WHENconstruct using the current expression as a base.inherited -
cast<
D2> () → Expression< D2> -
Generates a
CAST(expression AS TYPE)expression.inherited -
collate(
Collate collate) → Expression< String> -
Available on Expression<
Uses the givenString?> , provided by the StringExpressionOperators extensioncollatesequence when comparing this column to other values. -
contains(
String substring) → Expression< bool?> -
Available on Expression<
Whether this expression containsString?> , provided by the StringExpressionOperators extensionsubstring. -
count(
{bool distinct = false, Expression< bool?> ? filter}) → Expression<int> -
Available on Expression<
Returns how often this expression is non-null in the current group.DT> , provided by the BaseAggregate extension -
dartCast<
D2> () → 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
comparevalue 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
-
equalsValue(
D? dartValue) → Expression< bool> -
Compares this column against the mapped
dartValue. -
findType(
SqlTypeSystem types) → SqlType< S> -
Finds the runtime implementation of
Din the providedtypes.inherited -
groupConcat(
{String separator = ',', bool distinct = false, Expression< bool?> ? filter}) → Expression<String?> -
Available on Expression<
Returns the concatenation of all non-null values in the current group, joined by theDT> , provided by the BaseAggregate extensionseparator. -
isAcceptableOrUnknown(
Expression 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
-
isBetween(
Expression< DT> lower, Expression<DT> higher, {bool not = false}) → Expression<bool?> -
Available on Expression<
Returns an expression evaluating to true if this expression is betweenDT> , provided by the ComparableExpr extensionlowerandhigher(both inclusive). -
isBetweenValues(
DT lower, DT higher, {bool not = false}) → Expression< bool?> -
Available on Expression<
Returns an expression evaluating to true if this expression is betweenDT> , provided by the ComparableExpr extensionlowerandhigher(both inclusive). -
isBiggerOrEqual(
Expression< DT> other) → Expression<bool?> -
Available on Expression<
Returns an expression that is true if this expression is bigger than or equal to he other expression.DT> , provided by the ComparableExpr extension -
isBiggerOrEqualValue(
DT other) → Expression< bool?> -
Available on Expression<
Returns an expression that is true if this expression is bigger than or equal to he other value.DT> , provided by the ComparableExpr extension -
isBiggerThan(
Expression< DT> other) → Expression<bool?> -
Available on Expression<
Returns an expression that is true if this expression is strictly bigger than the other expression.DT> , provided by the ComparableExpr extension -
isBiggerThanValue(
DT other) → Expression< bool?> -
Available on Expression<
Returns an expression that is true if this expression is strictly bigger than the other value.DT> , provided by the ComparableExpr extension -
isIn(
Iterable< S> values) → Expression<bool?> -
An expression that is true if
thisresolves to any of the values invalues.inherited -
isInQuery(
BaseSelectStatement select) → Expression< bool?> -
An expression checking whether
thisis included in any row of the providedselectstatement.inherited -
isNotIn(
Iterable< S> values) → Expression<bool?> -
An expression that is true if
thisdoes not resolve to any of the values invalues.inherited -
isNotInQuery(
BaseSelectStatement select) → Expression< bool?> -
An expression checking whether
thisis not included in any row of the providedselectstatement.inherited -
isNotNull(
) → Expression< bool> -
Available on Expression, provided by the SqlIsNull extension
Expression that is true if the inner expression resolves to a non-null value. -
isNull(
) → Expression< bool> -
Available on Expression, provided by the SqlIsNull extension
Expression that is true if the inner expression resolves to a null value. -
isSmallerOrEqual(
Expression< DT> other) → Expression<bool?> -
Available on Expression<
Returns an expression that is true if this expression is smaller than or equal to he other expression.DT> , provided by the ComparableExpr extension -
isSmallerOrEqualValue(
DT other) → Expression< bool?> -
Available on Expression<
Returns an expression that is true if this expression is smaller than or equal to he other value.DT> , provided by the ComparableExpr extension -
isSmallerThan(
Expression< DT> other) → Expression<bool?> -
Available on Expression<
Returns an expression that is true if this expression is strictly smaller than the other expression.DT> , provided by the ComparableExpr extension -
isSmallerThanValue(
DT other) → Expression< bool?> -
Available on Expression<
Returns an expression that is true if this expression is strictly smaller than the other value.DT> , provided by the ComparableExpr extension -
like(
String regex) → Expression< bool?> -
Available on Expression<
Whether this column matches the given pattern. For details on what patters are valid and how they are interpreted, check out this tutorial.String?> , provided by the StringExpressionOperators extension -
lower(
) → Expression< String?> -
Available on Expression<
Calls the sqlite functionString?> , provided by the StringExpressionOperators extensionLOWERonthisstring. Please note that, in most sqlite installations, this only affects ascii chars. -
max(
{Expression< bool?> ? filter}) → Expression<DateTime> -
Available on Expression<
Return the maximum of all non-null values in this group.DateTime?> , provided by the DateTimeAggregate extension -
max(
{Expression< bool?> ? filter}) → Expression<DT?> -
Available on Expression<
Return the maximum of all non-null values in this group.DT?> , provided by the ArithmeticAggregates extension -
max(
{Expression< bool?> ? filter}) → Expression<DT?> -
Available on Expression<
Return the maximum of all non-null values in this group.DT?> , provided by the BigIntAggregates extension -
min(
{Expression< bool?> ? filter}) → Expression<DT?> -
Available on Expression<
Return the minimum of all non-null values in this group.DT?> , provided by the BigIntAggregates extension -
min(
{Expression< bool?> ? filter}) → Expression<DT?> -
Available on Expression<
Return the minimum of all non-null values in this group.DT?> , provided by the ArithmeticAggregates extension -
min(
{Expression< bool?> ? filter}) → Expression<DateTime> -
Available on Expression<
Return the minimum of all non-null values in this group.DateTime?> , provided by the DateTimeAggregate extension -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
not(
) → Expression< bool?> -
Available on Expression<
Negates this boolean expression. The returned expression is true ifbool?> , provided by the BooleanExpressionOperators extensionthisis false, and vice versa. -
regexp(
String regex, {bool multiLine = false, bool caseSensitive = true, bool unicode = false, bool dotAll = false}) → Expression< bool?> -
Available on Expression<
Matches this string against the regular expression inString?> , provided by the StringExpressionOperators extensionregex. -
roundToInt(
) → Expression< int?> -
Available on Expression<
Rounds this expression to the nearest integer.DT> , provided by the ArithmeticExpr extension -
roundToInt(
) → Expression< int?> -
Available on Expression<
Rounds this expression to the nearest integer.DT> , provided by the ArithmeticBigIntExpr extension -
sum(
{Expression< bool?> ? filter}) → Expression<DT?> -
Available on Expression<
Calculate the sum of all non-null values in the group.DT?> , provided by the BigIntAggregates extension -
sum(
{Expression< bool?> ? filter}) → Expression<DT?> -
Available on Expression<
Calculate the sum of all non-null values in the group.DT?> , provided by the ArithmeticAggregates extension -
toString(
) → String -
A string representation of this object.
inherited
-
total(
{Expression< bool?> ? filter}) → Expression<double?> -
Available on Expression<
Calculate the sum of all non-null values in the group.DT?> , provided by the BigIntAggregates extension -
total(
{Expression< bool?> ? filter}) → Expression<double?> -
Available on Expression<
Calculate the sum of all non-null values in the group.DT?> , provided by the ArithmeticAggregates extension -
trim(
) → Expression< String?> -
Available on Expression<
Removes spaces from both ends of this string.String?> , provided by the StringExpressionOperators extension -
trimLeft(
) → Expression< String?> -
Available on Expression<
Removes spaces from the beginning of this string.String?> , provided by the StringExpressionOperators extension -
trimRight(
) → Expression< String?> -
Available on Expression<
Removes spaces from the end of this string.String?> , provided by the StringExpressionOperators extension -
upper(
) → Expression< String?> -
Available on Expression<
Calls the sqlite functionString?> , provided by the StringExpressionOperators extensionUPPERonthisstring. Please note that, in most sqlite installations, this only affects ascii chars. -
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 ofthisexpression 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 inner) → void -
If this Expression wraps an
innerexpression, 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
contextby 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 &(
Expression< bool?> other) → Expression<bool?> -
Available on Expression<
Returns an expression that is true iff bothbool?> , provided by the BooleanExpressionOperators extensionthisandotherare true. -
operator *(
Expression< DT> other) → Expression<DT> -
Available on Expression<
Performs a multiplication (DT> , provided by the ArithmeticBigIntExpr extensionthis*other) in sql. -
operator *(
Expression< DT> other) → Expression<DT> -
Available on Expression<
Performs a multiplication (DT> , provided by the ArithmeticExpr extensionthis*other) in sql. -
operator +(
Expression< DT> other) → Expression<DT> -
Available on Expression<
Performs an addition (DT> , provided by the ArithmeticBigIntExpr extensionthis+other) in sql. -
operator +(
Expression< DT> other) → Expression<DT> -
Available on Expression<
Performs an addition (DT> , provided by the ArithmeticExpr extensionthis+other) in sql. -
operator +(
Duration duration) → Expression< DateTime> -
Available on Expression<
AddsDateTime?> , provided by the DateTimeExpressions extensiondurationfrom this date. -
operator +(
Expression< String?> other) → Expression<String> -
Available on Expression<
Performs a string concatenation in sql by appendingString?> , provided by the StringExpressionOperators extensionothertothis. -
operator -(
Expression< DT> other) → Expression<DT> -
Available on Expression<
Performs a subtraction (DT> , provided by the ArithmeticBigIntExpr extensionthis-other) in sql. -
operator -(
Expression< DT> other) → Expression<DT> -
Available on Expression<
Performs a subtraction (DT> , provided by the ArithmeticExpr extensionthis-other) in sql. -
operator -(
Duration duration) → Expression< DateTime> -
Available on Expression<
SubtractsDateTime?> , provided by the DateTimeExpressions extensiondurationfrom this date. -
operator /(
Expression< DT> other) → Expression<DT> -
Available on Expression<
Performs a division (DT> , provided by the ArithmeticBigIntExpr extensionthis/other) in sql. -
operator /(
Expression< DT> other) → Expression<DT> -
Available on Expression<
Performs a division (DT> , provided by the ArithmeticExpr extensionthis/other) in sql. -
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator unary-(
) → Expression< DT> -
Available on Expression<
Returns the negation of this value.DT> , provided by the ArithmeticBigIntExpr extension -
operator unary-(
) → Expression< DT> -
Available on Expression<
Returns the negation of this value.DT> , provided by the ArithmeticExpr extension -
operator |(
Expression< bool?> other) → Expression<bool?> -
Available on Expression<
Returns an expression that is true ifbool?> , provided by the BooleanExpressionOperators extensionthisorotherare true.