Skip to content

Commit

Permalink
add is/isnot ops
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 committed May 1, 2019
1 parent 159322e commit 003d250
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Sources/SQLKit/Query/SQLBinaryOperator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public enum SQLBinaryOperator: SQLExpression {

/// `-`
case subtract

/// `IS`
case `is`

/// `IS NOT`
case isNot

public func serialize(to serializer: inout SQLSerializer) {
switch self {
Expand All @@ -62,6 +68,12 @@ public enum SQLBinaryOperator: SQLExpression {
case .or: serializer.write("OR")
case .in: serializer.write("IN")
case .notIn: serializer.write("NOT IN")
case .greaterThan: serializer.write(">")
case .greaterThanOrEqual: serializer.write(">=")
case .lessThan: serializer.write("<")
case .lessThanOrEqual: serializer.write("<=")
case .is: serializer.write("IS")
case .isNot: serializer.write("IS NOT")
default:
print(self)
fatalError()
Expand Down

0 comments on commit 003d250

Please sign in to comment.