equals method

Expr<bool> equals(
  1. Expr<DateTime?> value
)

Compare this expression to value using = in SQL coalesced to FALSE.

This is equivalent to COALESCE(this = value, FALSE) in SQL.

The .equals extension method requires that one of the two operators are non-nullable. Because NULL = NULL evaluates to UNKNOWN in SQL, which is surprising in a Dart context.

If you wish to compare two nullable expressions you can use:

  • isNotDistinctFrom, to get NULL equivalent to NULL, or,
  • equalsUnlessNull, to explicitely get the SQL = semantics.

Implementation

Expr<bool> equals(Expr<DateTime?> value) =>
    ExpressionEquals(this, value).orElseValue(false);