Field<T> class sealed

The difference between "the caller did not mention this column" and "the caller set this column to NULL".

A Patch carries one of these per writable column:

  • AbsentField — the column is not named in the statement. On an UPDATE, the row keeps what it holds; on an INSERT, the column takes its default.
  • ValueField — the column is named, and its value is ValueField.value.

Only a nullable column accepts Field<T?>.value(null); a non-null column given Field<T>.value(null) is a programming error caught at the type level, because T is not nullable.

final clearCity = CustomerPatch(city: Field<String?>.value(null));
final keepCity = CustomerPatch();
Implementers
Annotations
  • @immutable

Constructors

Field.absent()
The column is not named.
const
factory
Field.value(T value)
The column is named and carries value.
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isAbsent bool
Whether this is AbsentField.
no setter
isPresent bool
Whether this is ValueField.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T
The carried value. Throws if this is AbsentField.
no setter
valueOrNull → T?
The value, or null when absent.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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