@@ -14,7 +14,8 @@ extension QueryExpression where QueryValue: QueryBindable {
14
14
/// - rhs: Another expression to compare.
15
15
/// - Returns: A predicate expression.
16
16
public static func == (
17
- lhs: Self , rhs: some QueryExpression < QueryValue >
17
+ lhs: Self ,
18
+ rhs: some QueryExpression < QueryValue >
18
19
) -> some QueryExpression < Bool > {
19
20
lhs. eq ( rhs)
20
21
}
@@ -34,27 +35,12 @@ extension QueryExpression where QueryValue: QueryBindable {
34
35
/// - rhs: Another expression to compare.
35
36
/// - Returns: A predicate expression.
36
37
public static func != (
37
- lhs: Self , rhs: some QueryExpression < QueryValue >
38
+ lhs: Self ,
39
+ rhs: some QueryExpression < QueryValue >
38
40
) -> some QueryExpression < Bool > {
39
41
lhs. neq ( rhs)
40
42
}
41
43
42
- @_disfavoredOverload
43
- @_documentation ( visibility: private)
44
- public static func == (
45
- lhs: Self , rhs: some QueryExpression < QueryValue ? >
46
- ) -> some QueryExpression < Bool > {
47
- BinaryOperator ( lhs: lhs, operator: isNull ( rhs) ? " IS " : " = " , rhs: rhs)
48
- }
49
-
50
- @_disfavoredOverload
51
- @_documentation ( visibility: private)
52
- public static func != (
53
- lhs: Self , rhs: some QueryExpression < QueryValue ? >
54
- ) -> some QueryExpression < Bool > {
55
- BinaryOperator ( lhs: lhs, operator: isNull ( rhs) ? " IS NOT " : " <> " , rhs: rhs)
56
- }
57
-
58
44
/// Returns a predicate expression indicating whether two query expressions are equal.
59
45
///
60
46
/// ```swift
@@ -119,34 +105,6 @@ private func isNull<Value>(_ expression: some QueryExpression<Value>) -> Bool {
119
105
}
120
106
121
107
extension QueryExpression where QueryValue: QueryBindable & _OptionalProtocol {
122
- @_documentation ( visibility: private)
123
- public static func == (
124
- lhs: Self , rhs: some QueryExpression < QueryValue . Wrapped >
125
- ) -> some QueryExpression < Bool > {
126
- BinaryOperator ( lhs: lhs, operator: isNull ( lhs) ? " IS " : " = " , rhs: rhs)
127
- }
128
-
129
- @_documentation ( visibility: private)
130
- public static func != (
131
- lhs: Self , rhs: some QueryExpression < QueryValue . Wrapped >
132
- ) -> some QueryExpression < Bool > {
133
- BinaryOperator ( lhs: lhs, operator: isNull ( lhs) ? " IS NOT " : " <> " , rhs: rhs)
134
- }
135
-
136
- @_documentation ( visibility: private)
137
- public static func == (
138
- lhs: Self , rhs: some QueryExpression < QueryValue >
139
- ) -> some QueryExpression < Bool > {
140
- BinaryOperator ( lhs: lhs, operator: isNull ( lhs) || isNull ( rhs) ? " IS " : " = " , rhs: rhs)
141
- }
142
-
143
- @_documentation ( visibility: private)
144
- public static func != (
145
- lhs: Self , rhs: some QueryExpression < QueryValue >
146
- ) -> some QueryExpression < Bool > {
147
- BinaryOperator ( lhs: lhs, operator: isNull ( lhs) || isNull ( rhs) ? " IS NOT " : " <> " , rhs: rhs)
148
- }
149
-
150
108
@_documentation ( visibility: private)
151
109
public func eq( _ other: some QueryExpression < QueryValue . Wrapped > ) -> some QueryExpression < Bool > {
152
110
BinaryOperator ( lhs: self , operator: " = " , rhs: other)
@@ -183,16 +141,6 @@ extension QueryExpression where QueryValue: QueryBindable & _OptionalProtocol {
183
141
}
184
142
185
143
extension QueryExpression where QueryValue: QueryBindable {
186
- @_documentation ( visibility: private)
187
- public static func == ( lhs: Self , rhs: _Null < QueryValue > ) -> some QueryExpression < Bool > {
188
- lhs. is ( rhs)
189
- }
190
-
191
- @_documentation ( visibility: private)
192
- public static func != ( lhs: Self , rhs: _Null < QueryValue > ) -> some QueryExpression < Bool > {
193
- lhs. isNot ( rhs)
194
- }
195
-
196
144
@_documentation ( visibility: private)
197
145
public func `is`(
198
146
_ other: _Null < QueryValue >
@@ -217,6 +165,80 @@ extension _Null: ExpressibleByNilLiteral {
217
165
public init ( nilLiteral: ( ) ) { }
218
166
}
219
167
168
+ // NB: This overload is required due to an overload resolution bug of 'Updates[dynamicMember:]'.
169
+ @_disfavoredOverload
170
+ @_documentation ( visibility: private)
171
+ public func == < QueryValue> (
172
+ lhs: any QueryExpression < QueryValue > ,
173
+ rhs: some QueryExpression < QueryValue ? >
174
+ ) -> some QueryExpression < Bool > {
175
+ BinaryOperator ( lhs: lhs, operator: isNull ( rhs) ? " IS " : " = " , rhs: rhs)
176
+ }
177
+
178
+ // NB: This overload is required due to an overload resolution bug of 'Updates[dynamicMember:]'.
179
+ @_disfavoredOverload
180
+ @_documentation ( visibility: private)
181
+ public func != < QueryValue> (
182
+ lhs: any QueryExpression < QueryValue > ,
183
+ rhs: some QueryExpression < QueryValue ? >
184
+ ) -> some QueryExpression < Bool > {
185
+ BinaryOperator ( lhs: lhs, operator: isNull ( rhs) ? " IS NOT " : " <> " , rhs: rhs)
186
+ }
187
+
188
+ // NB: This overload is required due to an overload resolution bug of 'Updates[dynamicMember:]'.
189
+ @_documentation ( visibility: private)
190
+ public func == < QueryValue: _OptionalProtocol > (
191
+ lhs: any QueryExpression < QueryValue > ,
192
+ rhs: some QueryExpression < QueryValue . Wrapped >
193
+ ) -> some QueryExpression < Bool > {
194
+ BinaryOperator ( lhs: lhs, operator: isNull ( lhs) ? " IS " : " = " , rhs: rhs)
195
+ }
196
+
197
+ // NB: This overload is required due to an overload resolution bug of 'Updates[dynamicMember:]'.
198
+ @_documentation ( visibility: private)
199
+ public func != < QueryValue: _OptionalProtocol > (
200
+ lhs: any QueryExpression < QueryValue > ,
201
+ rhs: some QueryExpression < QueryValue . Wrapped >
202
+ ) -> some QueryExpression < Bool > {
203
+ BinaryOperator ( lhs: lhs, operator: isNull ( lhs) ? " IS NOT " : " <> " , rhs: rhs)
204
+ }
205
+
206
+ // NB: This overload is required due to an overload resolution bug of 'Updates[dynamicMember:]'.
207
+ @_documentation ( visibility: private)
208
+ public func == < QueryValue: _OptionalProtocol > (
209
+ lhs: any QueryExpression < QueryValue > ,
210
+ rhs: some QueryExpression < QueryValue >
211
+ ) -> some QueryExpression < Bool > {
212
+ BinaryOperator ( lhs: lhs, operator: isNull ( lhs) || isNull ( rhs) ? " IS " : " = " , rhs: rhs)
213
+ }
214
+
215
+ // NB: This overload is required due to an overload resolution bug of 'Updates[dynamicMember:]'.
216
+ @_documentation ( visibility: private)
217
+ public func != < QueryValue: _OptionalProtocol > (
218
+ lhs: any QueryExpression < QueryValue > ,
219
+ rhs: some QueryExpression < QueryValue >
220
+ ) -> some QueryExpression < Bool > {
221
+ BinaryOperator ( lhs: lhs, operator: isNull ( lhs) || isNull ( rhs) ? " IS NOT " : " <> " , rhs: rhs)
222
+ }
223
+
224
+ // NB: This overload is required due to an overload resolution bug of 'Updates[dynamicMember:]'.
225
+ @_documentation ( visibility: private)
226
+ public func == < QueryValue: QueryBindable > (
227
+ lhs: any QueryExpression < QueryValue > ,
228
+ rhs: _Null < QueryValue >
229
+ ) -> some QueryExpression < Bool > {
230
+ SQLQueryExpression ( lhs) . is ( rhs)
231
+ }
232
+
233
+ // NB: This overload is required due to an overload resolution bug of 'Updates[dynamicMember:]'.
234
+ @_documentation ( visibility: private)
235
+ public func != < QueryValue: QueryBindable > (
236
+ lhs: any QueryExpression < QueryValue > ,
237
+ rhs: _Null < QueryValue >
238
+ ) -> some QueryExpression < Bool > {
239
+ SQLQueryExpression ( lhs) . isNot ( rhs)
240
+ }
241
+
220
242
extension QueryExpression where QueryValue: QueryBindable {
221
243
/// Returns a predicate expression indicating whether the value of the first expression is less
222
244
/// than that of the second expression.
@@ -229,7 +251,8 @@ extension QueryExpression where QueryValue: QueryBindable {
229
251
/// - rhs: Another expression to compare.
230
252
/// - Returns: A predicate expression.
231
253
public static func < (
232
- lhs: Self , rhs: some QueryExpression < QueryValue >
254
+ lhs: Self ,
255
+ rhs: some QueryExpression < QueryValue >
233
256
) -> some QueryExpression < Bool > {
234
257
lhs. lt ( rhs)
235
258
}
@@ -245,7 +268,8 @@ extension QueryExpression where QueryValue: QueryBindable {
245
268
/// - rhs: Another expression to compare.
246
269
/// - Returns: A predicate expression.
247
270
public static func > (
248
- lhs: Self , rhs: some QueryExpression < QueryValue >
271
+ lhs: Self ,
272
+ rhs: some QueryExpression < QueryValue >
249
273
) -> some QueryExpression < Bool > {
250
274
lhs. gt ( rhs)
251
275
}
@@ -261,7 +285,8 @@ extension QueryExpression where QueryValue: QueryBindable {
261
285
/// - rhs: Another expression to compare.
262
286
/// - Returns: A predicate expression.
263
287
public static func <= (
264
- lhs: Self , rhs: some QueryExpression < QueryValue >
288
+ lhs: Self ,
289
+ rhs: some QueryExpression < QueryValue >
265
290
) -> some QueryExpression < Bool > {
266
291
lhs. lte ( rhs)
267
292
}
@@ -277,7 +302,8 @@ extension QueryExpression where QueryValue: QueryBindable {
277
302
/// - rhs: Another expression to compare.
278
303
/// - Returns: A predicate expression.
279
304
public static func >= (
280
- lhs: Self , rhs: some QueryExpression < QueryValue >
305
+ lhs: Self ,
306
+ rhs: some QueryExpression < QueryValue >
281
307
) -> some QueryExpression < Bool > {
282
308
lhs. gte ( rhs)
283
309
}
@@ -338,7 +364,8 @@ extension QueryExpression where QueryValue == Bool {
338
364
/// - rhs: The right-hand side of the operation.
339
365
/// - Returns: A predicate expression.
340
366
public static func && (
341
- lhs: Self , rhs: some QueryExpression < QueryValue >
367
+ lhs: Self ,
368
+ rhs: some QueryExpression < QueryValue >
342
369
) -> some QueryExpression < QueryValue > {
343
370
lhs. and ( rhs)
344
371
}
@@ -353,7 +380,8 @@ extension QueryExpression where QueryValue == Bool {
353
380
/// - rhs: The right-hand side of the operation.
354
381
/// - Returns: A predicate expression.
355
382
public static func || (
356
- lhs: Self , rhs: some QueryExpression < QueryValue >
383
+ lhs: Self ,
384
+ rhs: some QueryExpression < QueryValue >
357
385
) -> some QueryExpression < QueryValue > {
358
386
lhs. or ( rhs)
359
387
}
@@ -415,7 +443,8 @@ extension QueryExpression where QueryValue: Numeric {
415
443
/// - rhs: The second expression to add.
416
444
/// - Returns: A sum expression.
417
445
public static func + (
418
- lhs: Self , rhs: some QueryExpression < QueryValue >
446
+ lhs: Self ,
447
+ rhs: some QueryExpression < QueryValue >
419
448
) -> some QueryExpression < QueryValue > {
420
449
BinaryOperator ( lhs: lhs, operator: " + " , rhs: rhs)
421
450
}
@@ -427,7 +456,8 @@ extension QueryExpression where QueryValue: Numeric {
427
456
/// - rhs: The second expression to subtract.
428
457
/// - Returns: A difference expression.
429
458
public static func - (
430
- lhs: Self , rhs: some QueryExpression < QueryValue >
459
+ lhs: Self ,
460
+ rhs: some QueryExpression < QueryValue >
431
461
) -> some QueryExpression < QueryValue > {
432
462
BinaryOperator ( lhs: lhs, operator: " - " , rhs: rhs)
433
463
}
@@ -439,7 +469,8 @@ extension QueryExpression where QueryValue: Numeric {
439
469
/// - rhs: The second expression to multiply.
440
470
/// - Returns: A product expression.
441
471
public static func * (
442
- lhs: Self , rhs: some QueryExpression < QueryValue >
472
+ lhs: Self ,
473
+ rhs: some QueryExpression < QueryValue >
443
474
) -> some QueryExpression < QueryValue > {
444
475
BinaryOperator ( lhs: lhs, operator: " * " , rhs: rhs)
445
476
}
@@ -451,7 +482,8 @@ extension QueryExpression where QueryValue: Numeric {
451
482
/// - rhs: The second expression to divide.
452
483
/// - Returns: A quotient expression.
453
484
public static func / (
454
- lhs: Self , rhs: some QueryExpression < QueryValue >
485
+ lhs: Self ,
486
+ rhs: some QueryExpression < QueryValue >
455
487
) -> some QueryExpression < QueryValue > {
456
488
BinaryOperator ( lhs: lhs, operator: " / " , rhs: rhs)
457
489
}
@@ -546,7 +578,8 @@ extension QueryExpression where QueryValue: BinaryInteger {
546
578
/// - rhs: The value to divide `lhs` by.
547
579
/// - Returns: An expression representing the remainder, or `NULL` if `rhs` is zero.
548
580
public static func % (
549
- lhs: Self , rhs: some QueryExpression < QueryValue >
581
+ lhs: Self ,
582
+ rhs: some QueryExpression < QueryValue >
550
583
) -> some QueryExpression < QueryValue ? > {
551
584
BinaryOperator ( lhs: lhs, operator: " % " , rhs: rhs)
552
585
}
@@ -558,7 +591,8 @@ extension QueryExpression where QueryValue: BinaryInteger {
558
591
/// - rhs: Another integer expression.
559
592
/// - Returns: An expression representing a bitwise AND operation on the two given expressions.
560
593
public static func & (
561
- lhs: Self , rhs: some QueryExpression < QueryValue >
594
+ lhs: Self ,
595
+ rhs: some QueryExpression < QueryValue >
562
596
) -> some QueryExpression < QueryValue > {
563
597
BinaryOperator ( lhs: lhs, operator: " & " , rhs: rhs)
564
598
}
@@ -570,7 +604,8 @@ extension QueryExpression where QueryValue: BinaryInteger {
570
604
/// - rhs: Another integer expression.
571
605
/// - Returns: An expression representing a bitwise OR operation on the two given expressions.
572
606
public static func | (
573
- lhs: Self , rhs: some QueryExpression < QueryValue >
607
+ lhs: Self ,
608
+ rhs: some QueryExpression < QueryValue >
574
609
) -> some QueryExpression < QueryValue > {
575
610
BinaryOperator ( lhs: lhs, operator: " | " , rhs: rhs)
576
611
}
@@ -583,7 +618,8 @@ extension QueryExpression where QueryValue: BinaryInteger {
583
618
/// - rhs: Another integer expression.
584
619
/// - Returns: An expression representing a left bitshift operation on the two given expressions.
585
620
public static func << (
586
- lhs: Self , rhs: some QueryExpression < QueryValue >
621
+ lhs: Self ,
622
+ rhs: some QueryExpression < QueryValue >
587
623
) -> some QueryExpression < QueryValue > {
588
624
BinaryOperator ( lhs: lhs, operator: " << " , rhs: rhs)
589
625
}
@@ -596,7 +632,8 @@ extension QueryExpression where QueryValue: BinaryInteger {
596
632
/// - rhs: Another integer expression.
597
633
/// - Returns: An expression representing a right bitshift operation on the two given expressions.
598
634
public static func >> (
599
- lhs: Self , rhs: some QueryExpression < QueryValue >
635
+ lhs: Self ,
636
+ rhs: some QueryExpression < QueryValue >
600
637
) -> some QueryExpression < QueryValue > {
601
638
BinaryOperator ( lhs: lhs, operator: " >> " , rhs: rhs)
602
639
}
@@ -647,7 +684,8 @@ extension QueryExpression where QueryValue == String {
647
684
/// - rhs: The second string expression.
648
685
/// - Returns: An expression concatenating the first expression with the second.
649
686
public static func + (
650
- lhs: Self , rhs: some QueryExpression < QueryValue >
687
+ lhs: Self ,
688
+ rhs: some QueryExpression < QueryValue >
651
689
) -> some QueryExpression < QueryValue > {
652
690
BinaryOperator ( lhs: lhs, operator: " || " , rhs: rhs)
653
691
}
@@ -762,7 +800,8 @@ extension SQLQueryExpression<String> {
762
800
/// - lhs: The column to append.
763
801
/// - rhs: The appended text.
764
802
public static func += (
765
- lhs: inout Self , rhs: some QueryExpression < QueryValue >
803
+ lhs: inout Self ,
804
+ rhs: some QueryExpression < QueryValue >
766
805
) {
767
806
lhs = Self ( lhs + rhs)
768
807
}
0 commit comments