Constant<T> class

An expression that represents the value of a dart object encoded to sql by writing them into the sql statements. For most cases, consider using Variable instead.

Inheritance
Available extensions

Constructors

Constant(T value)
Constructs a new constant (sql literal) holding the value.
const

Properties

date Expression<String?>

Available on Expression<DateTime?>, provided by the DateTimeExpressions extension

Formats this datetime in the format year-month-day.
no setter
day Expression<int?>

Available on Expression<DateTime?>, provided by the DateTimeExpressions extension

Extracts the (UTC) day from this datetime expression.
no setter
hashCode int
The hash code for this object.
no setteroverride
hour Expression<int?>

Available on Expression<DateTime?>, provided by the DateTimeExpressions extension

Extracts the (UTC) hour from this datetime expression.
no setter
isLiteral bool
Whether this expression is a literal. Some use-sites need to put parentheses around non-literals.
no setteroverride
length Expression<int?>

Available on Expression<String?>, provided by the StringExpressionOperators extension

Calls the sqlite function LENGTH on this string, 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<DateTime?>, provided by the DateTimeExpressions extension

Extracts the (UTC) minute from this datetime expression.
no setter
month Expression<int?>

Available on Expression<DateTime?>, provided by the DateTimeExpressions extension

Extracts the (UTC) month from this datetime expression.
no setter
precedence Precedence
The precedence of this expression. This can be used to automatically put parentheses around expressions as needed.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
second Expression<int?>

Available on Expression<DateTime?>, provided by the DateTimeExpressions extension

Extracts the (UTC) second from this datetime expression.
no setter
secondsSinceEpoch Expression<int>

Available on Expression<DateTime?>, provided by the DateTimeExpressions extension

Returns an expression containing the amount of seconds from the unix epoch (January 1st, 1970) to this datetime expression. The datetime is assumed to be in utc.
no setter
value → T
The value that will be converted to an sql literal.
final
year Expression<int?>

Available on Expression<DateTime?>, provided by the DateTimeExpressions extension

Extracts the (UTC) year from this datetime expression.
no setter

Methods

abs() Expression<DT>

Available on Expression<DT>, provided by the ArithmeticBigIntExpr extension

Calculates the absolute value of this number.
abs() Expression<DT>

Available on Expression<DT>, provided by the ArithmeticExpr extension

Calculates the absolute value of this number.
avg({Expression<bool?>? filter}) Expression<double?>

Available on Expression<DT?>, provided by the ArithmeticAggregates extension

Return the average of all non-null values in this group.
avg({Expression<bool?>? filter}) Expression<DateTime>

Available on Expression<DateTime?>, provided by the DateTimeAggregate extension

Return the average of all non-null values in this group. To only consider rows matching a predicate, you can set the optional filter. Note that filter is 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<DT?>, provided by the BigIntAggregates extension

Return the average of all non-null values in this group.
caseMatch<T>({required Map<Expression<T>, Expression<T?>> when, Expression<T?>? orElse}) Expression<T?>
A CASE WHEN construct 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<String?>, provided by the StringExpressionOperators extension

Uses the given collate sequence when comparing this column to other values.
contains(String substring) Expression<bool?>

Available on Expression<String?>, provided by the StringExpressionOperators extension

Whether this expression contains substring.
count({bool distinct = false, Expression<bool?>? filter}) Expression<int>

Available on Expression<DT>, provided by the BaseAggregate extension

Returns how often this expression is non-null in the current group.
dartCast<D2>() Expression<D2>
Casts this expression to an expression of D.
inherited
equals(T 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<T> compare) Expression<bool>
Whether this expression is equal to the given expression.
inherited
findType(SqlTypeSystem types) SqlType<T>
Finds the runtime implementation of D in the provided types.
inherited
groupConcat({String separator = ',', bool distinct = false, Expression<bool?>? filter}) Expression<String?>

Available on Expression<DT>, provided by the BaseAggregate extension

Returns the concatenation of all non-null values in the current group, joined by the separator.
isBetween(Expression<DT> lower, Expression<DT> higher, {bool not = false}) Expression<bool?>

Available on Expression<DT>, provided by the ComparableExpr extension

Returns an expression evaluating to true if this expression is between lower and higher (both inclusive).
isBetweenValues(DT lower, DT higher, {bool not = false}) Expression<bool?>

Available on Expression<DT>, provided by the ComparableExpr extension

Returns an expression evaluating to true if this expression is between lower and higher (both inclusive).
isBiggerOrEqual(Expression<DT> other) Expression<bool?>

Available on Expression<DT>, provided by the ComparableExpr extension

Returns an expression that is true if this expression is bigger than or equal to he other expression.
isBiggerOrEqualValue(DT other) Expression<bool?>

Available on Expression<DT>, provided by the ComparableExpr extension

Returns an expression that is true if this expression is bigger than or equal to he other value.
isBiggerThan(Expression<DT> other) Expression<bool?>

Available on Expression<DT>, provided by the ComparableExpr extension

Returns an expression that is true if this expression is strictly bigger than the other expression.
isBiggerThanValue(DT other) Expression<bool?>

Available on Expression<DT>, provided by the ComparableExpr extension

Returns an expression that is true if this expression is strictly bigger than the other value.
isIn(Iterable<T> values) Expression<bool?>
An expression that is true if this resolves to any of the values in values.
inherited
isInQuery(BaseSelectStatement select) Expression<bool?>
An expression checking whether this is included in any row of the provided select statement.
inherited
isNotIn(Iterable<T> values) Expression<bool?>
An expression that is true if this does not resolve to any of the values in values.
inherited
isNotInQuery(BaseSelectStatement select) Expression<bool?>
An expression checking whether this is not included in any row of the provided select statement.
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<DT>, provided by the ComparableExpr extension

Returns an expression that is true if this expression is smaller than or equal to he other expression.
isSmallerOrEqualValue(DT other) Expression<bool?>

Available on Expression<DT>, provided by the ComparableExpr extension

Returns an expression that is true if this expression is smaller than or equal to he other value.
isSmallerThan(Expression<DT> other) Expression<bool?>

Available on Expression<DT>, provided by the ComparableExpr extension

Returns an expression that is true if this expression is strictly smaller than the other expression.
isSmallerThanValue(DT other) Expression<bool?>

Available on Expression<DT>, provided by the ComparableExpr extension

Returns an expression that is true if this expression is strictly smaller than the other value.
like(String regex) Expression<bool?>

Available on Expression<String?>, provided by the StringExpressionOperators extension

Whether this column matches the given pattern. For details on what patters are valid and how they are interpreted, check out this tutorial.
lower() Expression<String?>

Available on Expression<String?>, provided by the StringExpressionOperators extension

Calls the sqlite function LOWER on this string. Please note that, in most sqlite installations, this only affects ascii chars.
max({Expression<bool?>? filter}) Expression<DT?>

Available on Expression<DT?>, provided by the ArithmeticAggregates extension

Return the maximum of all non-null values in this group.
max({Expression<bool?>? filter}) Expression<DateTime>

Available on Expression<DateTime?>, provided by the DateTimeAggregate extension

Return the maximum of all non-null values in this group.
max({Expression<bool?>? filter}) Expression<DT?>

Available on Expression<DT?>, provided by the BigIntAggregates extension

Return the maximum of all non-null values in this group.
min({Expression<bool?>? filter}) Expression<DT?>

Available on Expression<DT?>, provided by the BigIntAggregates extension

Return the minimum of all non-null values in this group.
min({Expression<bool?>? filter}) Expression<DateTime>

Available on Expression<DateTime?>, provided by the DateTimeAggregate extension

Return the minimum of all non-null values in this group.
min({Expression<bool?>? filter}) Expression<DT?>

Available on Expression<DT?>, provided by the ArithmeticAggregates extension

Return the minimum of all non-null values in this group.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
not() Expression<bool?>

Available on Expression<bool?>, provided by the BooleanExpressionOperators extension

Negates this boolean expression. The returned expression is true if this is false, and vice versa.
regexp(String regex, {bool multiLine = false, bool caseSensitive = true, bool unicode = false, bool dotAll = false}) Expression<bool?>

Available on Expression<String?>, provided by the StringExpressionOperators extension

Matches this string against the regular expression in regex.
roundToInt() Expression<int?>

Available on Expression<DT>, provided by the ArithmeticExpr extension

Rounds this expression to the nearest integer.
roundToInt() Expression<int?>

Available on Expression<DT>, provided by the ArithmeticBigIntExpr extension

Rounds this expression to the nearest integer.
sum({Expression<bool?>? filter}) Expression<DT?>

Available on Expression<DT?>, provided by the BigIntAggregates extension

Calculate the sum of all non-null values in the group.
sum({Expression<bool?>? filter}) Expression<DT?>

Available on Expression<DT?>, provided by the ArithmeticAggregates extension

Calculate the sum of all non-null values in the group.
toString() String
A string representation of this object.
override
total({Expression<bool?>? filter}) Expression<double?>

Available on Expression<DT?>, provided by the BigIntAggregates extension

Calculate the sum of all non-null values in the group.
total({Expression<bool?>? filter}) Expression<double?>

Available on Expression<DT?>, provided by the ArithmeticAggregates extension

Calculate the sum of all non-null values in the group.
trim() Expression<String?>

Available on Expression<String?>, provided by the StringExpressionOperators extension

Removes spaces from both ends of this string.
trimLeft() Expression<String?>

Available on Expression<String?>, provided by the StringExpressionOperators extension

Removes spaces from the beginning of this string.
trimRight() Expression<String?>

Available on Expression<String?>, provided by the StringExpressionOperators extension

Removes spaces from the end of this string.
upper() Expression<String?>

Available on Expression<String?>, provided by the StringExpressionOperators extension

Calls the sqlite function UPPER on this string. Please note that, in most sqlite installations, this only affects ascii chars.
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 of this expression is lower, it will be wrap}ped in
inherited
writeInner(GenerationContext ctx, Expression 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) → 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.
override

Operators

operator &(Expression<bool?> other) Expression<bool?>

Available on Expression<bool?>, provided by the BooleanExpressionOperators extension

Returns an expression that is true iff both this and other are true.
operator *(Expression<DT> other) Expression<DT>

Available on Expression<DT>, provided by the ArithmeticBigIntExpr extension

Performs a multiplication (this * other) in sql.
operator *(Expression<DT> other) Expression<DT>

Available on Expression<DT>, provided by the ArithmeticExpr extension

Performs a multiplication (this * other) in sql.
operator +(Expression<DT> other) Expression<DT>

Available on Expression<DT>, provided by the ArithmeticBigIntExpr extension

Performs an addition (this + other) in sql.
operator +(Expression<DT> other) Expression<DT>

Available on Expression<DT>, provided by the ArithmeticExpr extension

Performs an addition (this + other) in sql.
operator +(Duration duration) Expression<DateTime>

Available on Expression<DateTime?>, provided by the DateTimeExpressions extension

Adds duration from this date.
operator +(Expression<String?> other) Expression<String>

Available on Expression<String?>, provided by the StringExpressionOperators extension

Performs a string concatenation in sql by appending other to this.
operator -(Expression<DT> other) Expression<DT>

Available on Expression<DT>, provided by the ArithmeticBigIntExpr extension

Performs a subtraction (this - other) in sql.
operator -(Expression<DT> other) Expression<DT>

Available on Expression<DT>, provided by the ArithmeticExpr extension

Performs a subtraction (this - other) in sql.
operator -(Duration duration) Expression<DateTime>

Available on Expression<DateTime?>, provided by the DateTimeExpressions extension

Subtracts duration from this date.
operator /(Expression<DT> other) Expression<DT>

Available on Expression<DT>, provided by the ArithmeticBigIntExpr extension

Performs a division (this / other) in sql.
operator /(Expression<DT> other) Expression<DT>

Available on Expression<DT>, provided by the ArithmeticExpr extension

Performs a division (this / other) in sql.
operator ==(Object other) bool
The equality operator.
override
operator unary-() Expression<DT>

Available on Expression<DT>, provided by the ArithmeticBigIntExpr extension

Returns the negation of this value.
operator unary-() Expression<DT>

Available on Expression<DT>, provided by the ArithmeticExpr extension

Returns the negation of this value.
operator |(Expression<bool?> other) Expression<bool?>

Available on Expression<bool?>, provided by the BooleanExpressionOperators extension

Returns an expression that is true if this or other are true.