forked from vapor/postgres-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPostgreSQLBinaryOperator.swift
107 lines (74 loc) · 3.43 KB
/
PostgreSQLBinaryOperator.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/// PostgreSQL specific `SQLBinaryOperator`.
public struct PostgreSQLBinaryOperator: SQLBinaryOperator, Equatable, ExpressibleByStringLiteral {
/// See `SQLBinaryOperator`.
public static let add: PostgreSQLBinaryOperator = "+"
/// See `SQLBinaryOperator`.
public static let bitwiseAnd: PostgreSQLBinaryOperator = "&"
/// See `SQLBinaryOperator`.
public static let bitwiseOr: PostgreSQLBinaryOperator = "|"
/// See `SQLBinaryOperator`.
public static let bitwiseShiftLeft: PostgreSQLBinaryOperator = "<<"
/// See `SQLBinaryOperator`.
public static let bitwiseShiftRight: PostgreSQLBinaryOperator = ">>"
/// See `SQLBinaryOperator`.
public static let concatenate: PostgreSQLBinaryOperator = "||"
/// See `SQLBinaryOperator`.
public static let divide: PostgreSQLBinaryOperator = "/"
/// See `SQLBinaryOperator`.
public static let equal: PostgreSQLBinaryOperator = "="
/// See `SQLBinaryOperator`.
public static let greaterThan: PostgreSQLBinaryOperator = ">"
/// See `SQLBinaryOperator`.
public static let greaterThanOrEqual: PostgreSQLBinaryOperator = ">="
/// See `SQLBinaryOperator`.
public static let lessThan: PostgreSQLBinaryOperator = "<"
/// See `SQLBinaryOperator`.
public static let lessThanOrEqual: PostgreSQLBinaryOperator = "<="
/// See `SQLBinaryOperator`.
public static let modulo: PostgreSQLBinaryOperator = "%"
/// See `SQLBinaryOperator`.
public static let multiply: PostgreSQLBinaryOperator = "*"
/// See `SQLBinaryOperator`.
public static let notEqual: PostgreSQLBinaryOperator = "!="
/// See `SQLBinaryOperator`.
public static let subtract: PostgreSQLBinaryOperator = "-"
/// See `SQLBinaryOperator`.
public static let and: PostgreSQLBinaryOperator = "AND"
/// See `SQLBinaryOperator`.
public static let or: PostgreSQLBinaryOperator = "OR"
/// See `SQLBinaryOperator`.
public static let `in`: PostgreSQLBinaryOperator = "IN"
/// See `SQLBinaryOperator`.
public static let notIn: PostgreSQLBinaryOperator = "NOT IN"
/// See `SQLBinaryOperator`.
public static let `is`: PostgreSQLBinaryOperator = "IS"
/// See `SQLBinaryOperator`.
public static let isNot: PostgreSQLBinaryOperator = "IS NOT"
/// See `SQLBinaryOperator`.
public static let like: PostgreSQLBinaryOperator = "LIKE"
/// See `SQLBinaryOperator`.
public static let glob: PostgreSQLBinaryOperator = "GLOB"
/// See `SQLBinaryOperator`.
public static let match: PostgreSQLBinaryOperator = "MATCH"
/// See `SQLBinaryOperator`.
public static let regexp: PostgreSQLBinaryOperator = "~"
/// See `SQLBinaryOperator`.
public static let notLike: PostgreSQLBinaryOperator = "NOT LIKE"
/// See `SQLBinaryOperator`.
public static let notGlob: PostgreSQLBinaryOperator = "NOT GLOB"
/// See `SQLBinaryOperator`.
public static let notMatch: PostgreSQLBinaryOperator = "NOT MATCH"
/// See `SQLBinaryOperator`.
public static let notRegexp: PostgreSQLBinaryOperator = "NOT REGEXP"
/// See `SQLBinaryOperator`.
public static let ilike: PostgreSQLBinaryOperator = "ILIKE"
/// See `SQLBinaryOperator`.
public static let notILike: PostgreSQLBinaryOperator = "NOT ILIKE"
private let op: String
public init(stringLiteral value: String) {
self.op = value
}
public func serialize(_ binds: inout [Encodable]) -> String {
return op
}
}