Expr<T> class

A typed SQL expression that can also be selected as a result.

Operators build SQL without executing it. The codec controls bound values and result decoding; nullable predicates retain SQL three-valued logic.

Inheritance
Implemented types
Implementers
Available extensions

Properties

codec → Codec<T>
Encodes parameters and decodes this expression's result column.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

asc({NullOrder? nulls}) → OrderTerm
Orders ascending, optionally specifying where NULL values appear.
average() → Expr<double?>

Available on Expr<T>, provided by the NumericExpression extension

Computes a floating-point SQL average, or null for an empty group.
average({required int scale, DecimalRounding rounding = DecimalRounding.exact}) → Expr<Decimal?>

Available on Expr<T>, provided by the DecimalExpression extension

Averages non-null inputs, rounding once at the requested result scale. Empty/all-null input returns null; the default rejects lost digits.
constrained(int precision, int scale) → Expr<T>

Available on Expr<T>, provided by the DecimalExpression extension

Rounds and checks a decimal against the requested precision and scale.
contains(String text) → Expr<bool?>

Available on Expr<T>, provided by the TextExpression extension

Matches literal text anywhere, escaping LIKE wildcards %, _ and !.
count({bool distinct = false}) → Expr<int>
Counts non-NULL values, optionally counting only distinct values.
cursor(T value, {bool descending = false, NullOrder? nulls}) → CursorTerm
Builds a typed keyset boundary from this expression and a row value.
desc({NullOrder? nulls}) → OrderTerm
Orders descending, optionally specifying where NULL values appear.
divide(Decimal divisor, {required int scale, DecimalRounding rounding = DecimalRounding.exact}) → Expr<T>

Available on Expr<T>, provided by the DecimalExpression extension

Divides in SQL to an explicit scale without a floating-point intermediate.
divideExpression(Expr<Decimal?> divisor, {required int scale, DecimalRounding rounding = DecimalRounding.exact}) → Expr<Decimal?>

Available on Expr<T>, provided by the DecimalExpression extension

Divides two SQL expressions. A null operand produces null.
endsWith(String text) → Expr<bool?>

Available on Expr<T>, provided by the TextExpression extension

Matches a literal suffix; LIKE wildcards in text have no special meaning.
eq(Operand<T> other) → Expr<bool?>
Compares with a value or SQL expression using =.
gt(Operand<T> other) → Expr<bool?>
Tests whether this expression is greater than other.
gte(Operand<T> other) → Expr<bool?>
Tests whether this expression is greater than or equal to other.
isIn(Iterable<T> values) → Expr<bool?>
Tests membership in separately bound values; an empty list is false.
isInQuery<F extends Fields>(Query<T, F> query) → Expr<bool?>
Tests membership in a subquery selecting one SQL expression.
isNotNull() → Expr<bool>
Tests for a non-NULL value, yielding a non-null boolean.
isNull() → Expr<bool>
Tests for SQL NULL, yielding a non-null boolean.
like(String pattern) → Expr<bool?>

Available on Expr<T>, provided by the TextExpression extension

Matches a bound SQL LIKE pattern; % and _ remain wildcards.
lower() → Expr<T>

Available on Expr<T>, provided by the TextExpression extension

Converts text to lowercase using database rules, preserving nullability.
lt(Operand<T> other) → Expr<bool?>
Tests whether this expression is less than other.
lte(Operand<T> other) → Expr<bool?>
Tests whether this expression is less than or equal to other.
map<R>(R mapper(T)) → Selection<R>
Maps each decoded value in Dart, preserving the source SQL projection.
inherited
max() → Expr<T?>
Selects the maximum value, or null for an empty group.
min() → Expr<T?>
Selects the minimum value, or null for an empty group.
minus(Decimal n) → Expr<T>

Available on Expr<T>, provided by the DecimalExpression extension

Subtracts an exactly encoded decimal value.
minus(T n) → Expr<T>

Available on Expr<T>, provided by the NumericExpression extension

Subtracts a bound value in SQL.
minusExpression(Expr<Decimal?> other) → Expr<Decimal?>

Available on Expr<T>, provided by the DecimalExpression extension

Subtracts another decimal SQL expression.
ne(Operand<T> other) → Expr<bool?>
Compares with a value or SQL expression using <>.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
not() → Expr<bool?>

Available on Expr<bool?>, provided by the Predicate extension

Negates this predicate; SQL NULL remains unknown.
over({List<Expr<Object?>> partitionBy = const [], List<OrderTerm> orderBy = const [], WindowFrame? frame}) → Expr<T>
Turns an aggregate into a window expression.
plus(T n) → Expr<T>

Available on Expr<T>, provided by the NumericExpression extension

Adds a bound value in SQL.
plus(Decimal n) → Expr<T>

Available on Expr<T>, provided by the DecimalExpression extension

Adds an exactly encoded decimal value.
plusExpression(Expr<Decimal?> other) → Expr<Decimal?>

Available on Expr<T>, provided by the DecimalExpression extension

Adds another decimal SQL expression.
rounded(int scale, {DecimalRounding rounding = DecimalRounding.exact}) → Expr<T>

Available on Expr<T>, provided by the DecimalExpression extension

Rounds in SQL; DecimalRounding.exact rejects any lost nonzero digits.
startsWith(String text) → Expr<bool?>

Available on Expr<T>, provided by the TextExpression extension

Matches a literal prefix; LIKE wildcards in text have no special meaning.
sum({bool distinct = false}) → Expr<Decimal?>

Available on Expr<T>, provided by the DecimalExpression extension

Sums decimal values exactly, returning null for an empty group.
sum() → Expr<T?>

Available on Expr<T>, provided by the NumericExpression extension

Sums values, returning null for an empty group.
times(T n) → Expr<T>

Available on Expr<T>, provided by the NumericExpression extension

Multiplies by a bound value in SQL.
times(Decimal n) → Expr<T>

Available on Expr<T>, provided by the DecimalExpression extension

Multiplies by an exactly encoded decimal value.
timesExpression(Expr<Decimal?> other) → Expr<Decimal?>

Available on Expr<T>, provided by the DecimalExpression extension

Multiplies by another decimal SQL expression.
toString() → String
A string representation of this object.
inherited
upper() → Expr<T>

Available on Expr<T>, provided by the TextExpression extension

Converts text to uppercase using database rules, preserving nullability.
withPrecision(int digits) → Expr<T>

Available on Expr<T>, provided by the InstantExpression extension

Rounds to the requested fractional-second digits (0 through 6).
withPrecision(int digits) → Expr<T>

Available on Expr<T>, provided by the LocalDateTimeExpression extension

Rounds to the requested fractional-second digits (0 through 6).
withPrecision(int digits) → Expr<T>

Available on Expr<T>, provided by the TimeExpression extension

Rounds to the requested fractional-second digits (0 through 6).

Operators

operator ==(Object other) → bool
The equality operator.
inherited