When in, pushes a null value into the list resulting in in (null). This
is how TypeORM and Sequelize handle in (). in (null) is logically the equivalent
of = null, which returns null, which is a falsy expression in most SQL databases.
We recommend NOT using this strategy if you plan to use in in select, returning,
or output clauses, as the return type differs from the SqlBool default type.
When not in, casts the left operand as char and pushes a literal value into
the list resulting in cast({{lhs}} as char) not in ({{VALUE}}). Casting
is required to avoid database errors with non-string columns.
When
in
, pushes anull
value into the list resulting inin (null)
. This is how TypeORM and Sequelize handlein ()
.in (null)
is logically the equivalent of= null
, which returnsnull
, which is a falsy expression in most SQL databases. We recommend NOT using this strategy if you plan to usein
inselect
,returning
, oroutput
clauses, as the return type differs from theSqlBool
default type.When
not in
, casts the left operand aschar
and pushes a literal value into the list resulting incast({{lhs}} as char) not in ({{VALUE}})
. Casting is required to avoid database errors with non-string columns.See replaceWithNoncontingentExpression for an alternative strategy.