mirror of https://github.com/AMT-Cheif/drift.git
isIn and isNotIn expression support for MariaDB dialect
This commit is contained in:
parent
d1e7e11696
commit
82a8f84ad4
|
@ -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
|
/// An expression that is true if `this` resolves to any of the values in
|
||||||
/// [values].
|
/// [values].
|
||||||
Expression<bool> isIn(Iterable<D> values) {
|
Expression<bool> isIn(Iterable<D> values) {
|
||||||
|
if (values.isEmpty) {
|
||||||
|
return Constant(false);
|
||||||
|
}
|
||||||
return _InExpression(this, values.toList(), false);
|
return _InExpression(this, values.toList(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An expression that is true if `this` does not resolve to any of the values
|
/// An expression that is true if `this` does not resolve to any of the values
|
||||||
/// in [values].
|
/// in [values].
|
||||||
Expression<bool> isNotIn(Iterable<D> values) {
|
Expression<bool> isNotIn(Iterable<D> values) {
|
||||||
|
if (values.isEmpty) {
|
||||||
|
return Constant(true);
|
||||||
|
}
|
||||||
return _InExpression(this, values.toList(), true);
|
return _InExpression(this, values.toList(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue