Skip to content

Commit ba8a4d4

Browse files
javilumbralesrobertohuertasm
authored andcommitted
Add support for "NOT" operator in Where expressions (robertohuertasm#70)
1 parent 89c7f1c commit ba8a4d4

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Example/Assets/Scripts/SQLite.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2740,6 +2740,15 @@ private CompileResult CompileExpr (Expression expr, List<object> queryArgs)
27402740
CommandText = valr.CommandText,
27412741
Value = valr.Value != null ? ConvertTo (valr.Value, ty) : null
27422742
};
2743+
} else if (expr.NodeType == ExpressionType.Not) {
2744+
var u = (UnaryExpression)expr;
2745+
var ty = u.Type;
2746+
var valr = CompileExpr (u.Operand, queryArgs);
2747+
2748+
return new CompileResult {
2749+
CommandText = "NOT " + valr.CommandText,
2750+
Value = valr.Value != null ? valr.Value : null
2751+
};
27432752
} else if (expr.NodeType == ExpressionType.MemberAccess) {
27442753
var mem = (MemberExpression)expr;
27452754

0 commit comments

Comments
 (0)