isIn and isNotIn expression support for MariaDB dialect

This commit is contained in:
BananaMasterz 2023-07-20 01:05:52 +03:00
parent d1e7e11696
commit 82a8f84ad4
1 changed files with 6 additions and 0 deletions

View File

@ -142,12 +142,18 @@ abstract class Expression<D extends Object> implements FunctionParameter {
/// An expression that is true if `this` resolves to any of the values in
/// [values].
Expression<bool> isIn(Iterable<D> values) {
if (values.isEmpty) {
return Constant(false);
}
return _InExpression(this, values.toList(), false);
}
/// An expression that is true if `this` does not resolve to any of the values
/// in [values].
Expression<bool> isNotIn(Iterable<D> values) {
if (values.isEmpty) {
return Constant(true);
}
return _InExpression(this, values.toList(), true);
}