Skip to content

Commit 489537a

Browse files
authored
Fix not-regexp operator, add case insensitive regexp operators (vapor#139)
1 parent 367c120 commit 489537a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Sources/PostgreSQL/SQL/PostgreSQLBinaryOperator.swift

+10-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public struct PostgreSQLBinaryOperator: SQLBinaryOperator, Equatable, Expressibl
2323

2424
/// See `SQLBinaryOperator`.
2525
public static let equal: PostgreSQLBinaryOperator = "="
26-
26+
2727
/// See `SQLBinaryOperator`.
2828
public static let greaterThan: PostgreSQLBinaryOperator = ">"
2929

@@ -65,7 +65,7 @@ public struct PostgreSQLBinaryOperator: SQLBinaryOperator, Equatable, Expressibl
6565

6666
/// See `SQLBinaryOperator`.
6767
public static let isNot: PostgreSQLBinaryOperator = "IS NOT"
68-
68+
6969
/// See `SQLBinaryOperator`.
7070
public static let contains: PostgreSQLBinaryOperator = "@>"
7171

@@ -74,7 +74,7 @@ public struct PostgreSQLBinaryOperator: SQLBinaryOperator, Equatable, Expressibl
7474

7575
/// See `SQLBinaryOperator`.
7676
public static let overlap: PostgreSQLBinaryOperator = "&&"
77-
77+
7878
/// See `SQLBinaryOperator`.
7979
public static let like: PostgreSQLBinaryOperator = "LIKE"
8080

@@ -87,6 +87,9 @@ public struct PostgreSQLBinaryOperator: SQLBinaryOperator, Equatable, Expressibl
8787
/// See `SQLBinaryOperator`.
8888
public static let regexp: PostgreSQLBinaryOperator = "~"
8989

90+
/// See `SQLBinaryOperator`.
91+
public static let caseInsensitiveRegexp: PostgreSQLBinaryOperator = "~*"
92+
9093
/// See `SQLBinaryOperator`.
9194
public static let notLike: PostgreSQLBinaryOperator = "NOT LIKE"
9295

@@ -97,7 +100,10 @@ public struct PostgreSQLBinaryOperator: SQLBinaryOperator, Equatable, Expressibl
97100
public static let notMatch: PostgreSQLBinaryOperator = "NOT MATCH"
98101

99102
/// See `SQLBinaryOperator`.
100-
public static let notRegexp: PostgreSQLBinaryOperator = "NOT REGEXP"
103+
public static let notRegexp: PostgreSQLBinaryOperator = "!~"
104+
105+
/// See `SQLBinaryOperator`.
106+
public static let caseInsensitiveNotRegexp: PostgreSQLBinaryOperator = "!~*"
101107

102108
/// See `SQLBinaryOperator`.
103109
public static let ilike: PostgreSQLBinaryOperator = "ILIKE"

0 commit comments

Comments
 (0)