Field<T> class final

A writable column expression that can create mutation assignments.

Inheritance
Available extensions

Properties

codec Codec<T>
Encodes parameters and decodes this expression's result column.
finalinherited
definition Column<T>
The column's name, codec and physical constraints.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
table TableRef
The owning table occurrence, used to validate query scope.
finalinherited

Methods

and(Expr<bool?> other) Expr<bool?>

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

Requires both predicates to be true.
asc({NullOrder? nulls}) OrderTerm
Orders ascending, optionally specifying where NULL values appear.
inherited
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.
change(Change<T> change) List<Assignment>

Available on Field<T>, provided by the ChangeField extension

Omits unchanged fields and builds assignments for the other cases.
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.
count({bool distinct = false}) Expr<int>
Counts non-NULL values, optionally counting only distinct values.
inherited
cursor(T value, {bool descending = false, NullOrder? nulls}) CursorTerm
Builds a typed keyset boundary from this expression and a row value.
inherited
decrement(T amount) Assignment

Available on Field<T>, provided by the NumericField extension

Subtracts a bound amount from the stored value.
defaultValue() Assignment
Requests the database default rather than a Dart client default.
desc({NullOrder? nulls}) OrderTerm
Orders descending, optionally specifying where NULL values appear.
inherited
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.
eq(T value) Expr<bool?>
Compares with a bound value; null produces SQL IS NULL.
inherited
equals(Expr<T> other) Expr<bool?>
Compares two SQL expressions using = and SQL NULL semantics.
inherited
gt(T value) Expr<bool?>
Tests whether this value is greater than the bound value.
inherited
gte(T value) Expr<bool?>
Tests whether this value is greater than or equal to the bound value.
inherited
increment(T amount) Assignment

Available on Field<T>, provided by the NumericField extension

Adds a bound amount to the stored value.
isIn(Iterable<T> values) Expr<bool?>
Tests membership in separately bound values; an empty list is false.
inherited
isInQuery<F extends Fields>(Query<T, F> query) Expr<bool?>
Tests membership in a subquery selecting one SQL expression.
inherited
isNotNull() Expr<bool>
Tests for a non-NULL value, yielding a non-null boolean.
inherited
isNull() Expr<bool>
Tests for SQL NULL, yielding a non-null boolean.
inherited
like(String pattern) Expr<bool?>

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

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

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

Converts text to lowercase using database rules.
lt(T value) Expr<bool?>
Tests whether this value is less than the bound value.
inherited
lte(T value) Expr<bool?>
Tests whether this value is less than or equal to the bound value.
inherited
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.
inherited
min() Expr<T?>
Selects the minimum value, or null for an empty group.
inherited
minus(T n) Expr<T>

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

Subtracts a bound value in SQL.
minus(Decimal n) Expr<T>

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

Subtracts an exactly encoded decimal value.
minusExpression(Expr<Decimal?> other) Expr<Decimal?>

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

Subtracts another decimal SQL expression.
ne(T value) Expr<bool?>
Compares with a bound value; null produces SQL IS NOT NULL.
inherited
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.
or(Expr<bool?> other) Expr<bool?>

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

Requires either predicate to be true.
over({List<Expr<Object?>> partitionBy = const [], List<OrderTerm> orderBy = const [], WindowFrame? frame}) Expr<T>
Turns an aggregate into a window expression.
inherited
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.
set(T value) Assignment
Assigns a bound value, including NULL when the field is nullable.
setExpression(Expr<T> expression) Assignment
Assigns a SQL expression with the same Dart value type.
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(Decimal n) Expr<T>

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

Multiplies by an exactly encoded decimal value.
times(T n) Expr<T>

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

Multiplies by a bound value in SQL.
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<String>

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

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

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

Rounds to the requested fractional-second digits (0 through 6).
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).

Operators

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