Skip to content

Commit e881014

Browse files
committed
Allow "LIKE[c]" as operator (ILIKE)
Used by CoreData. We should also add the other ones.
1 parent 4982489 commit e881014

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/ZeeQL/Control/ComparisonOperation.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
// ZeeQLTests
44
//
55
// Created by Helge Heß on 24.08.19.
6-
// Copyright © 2019-2025 ZeeZide GmbH. All rights reserved.
6+
// Copyright © 2019-2026 ZeeZide GmbH. All rights reserved.
77
//
88

99
public enum ComparisonOperation: Hashable, RawRepresentable {
1010
// Cannot nest in Qualifier protocol in Swift 3.0, maybe later
1111
// TODO: lowercase cases (can use static vars for compat)
12+
// TODO: CoreData: LIKE[d], LIKE[cd], CONTAINS/BEGINSWITH/ENDSWITH([cd])
1213

1314
case other(String)
1415

@@ -113,7 +114,8 @@ public extension ComparisonOperation {
113114
case "<=", "=<": self = .lessThanOrEqual
114115
case "IN": self = .in
115116
case "LIKE", "like": self = .like
116-
case "ILIKE", "ilike", "caseInsensitiveLike:", "caseInsensitiveLike":
117+
case "ILIKE", "ilike", "caseInsensitiveLike:", "caseInsensitiveLike",
118+
"LIKE[c]": // CoreData
117119
self = .caseInsensitiveLike
118120
case "SQLLIKE": self = .SQLLike
119121
case "SQLILIKE": self = .SQLCaseInsensitiveLike

0 commit comments

Comments
 (0)