@@ -4,7 +4,7 @@ import Helpers
4
4
public class PostgrestFilterBuilder : PostgrestTransformBuilder , @unchecked Sendable {
5
5
public enum Operator : String , CaseIterable , Sendable {
6
6
case eq, neq, gt, gte, lt, lte, like, ilike, `is`, `in`, cs, cd, sl, sr, nxl, nxr, adj, ov, fts,
7
- plfts, phfts, wfts
7
+ plfts, phfts, wfts
8
8
}
9
9
10
10
// MARK: - Filters
@@ -17,10 +17,11 @@ public class PostgrestFilterBuilder: PostgrestTransformBuilder, @unchecked Senda
17
17
let queryValue = value. queryValue
18
18
19
19
mutableState. withValue {
20
- $0. request. query. append ( URLQueryItem (
21
- name: column,
22
- value: " not. \( op. rawValue) . \( queryValue) "
23
- ) )
20
+ $0. request. query. append (
21
+ URLQueryItem (
22
+ name: column,
23
+ value: " not. \( op. rawValue) . \( queryValue) "
24
+ ) )
24
25
}
25
26
26
27
return self
@@ -152,14 +153,6 @@ public class PostgrestFilterBuilder: PostgrestTransformBuilder, @unchecked Senda
152
153
return self
153
154
}
154
155
155
- @available ( * , deprecated, renamed: " like(_:pattern:) " )
156
- public func like(
157
- _ column: String ,
158
- value: any URLQueryRepresentable
159
- ) -> PostgrestFilterBuilder {
160
- like ( column, pattern: value)
161
- }
162
-
163
156
/// Match only rows where `column` matches all of `patterns` case-sensitively.
164
157
/// - Parameters:
165
158
/// - column: The column to filter on
@@ -206,14 +199,6 @@ public class PostgrestFilterBuilder: PostgrestTransformBuilder, @unchecked Senda
206
199
return self
207
200
}
208
201
209
- @available ( * , deprecated, renamed: " ilike(_:pattern:) " )
210
- public func ilike(
211
- _ column: String ,
212
- value: any URLQueryRepresentable
213
- ) -> PostgrestFilterBuilder {
214
- ilike ( column, pattern: value)
215
- }
216
-
217
202
/// Match only rows where `column` matches all of `patterns` case-insensitively.
218
203
/// - Parameters:
219
204
/// - column: The column to filter on
@@ -284,14 +269,6 @@ public class PostgrestFilterBuilder: PostgrestTransformBuilder, @unchecked Senda
284
269
return self
285
270
}
286
271
287
- @available ( * , deprecated, renamed: " in(_:values:) " )
288
- public func `in`(
289
- _ column: String ,
290
- value: [ any URLQueryRepresentable ]
291
- ) -> PostgrestFilterBuilder {
292
- `in` ( column, values: value)
293
- }
294
-
295
272
/// Match only rows where `column` contains every element appearing in `value`.
296
273
///
297
274
/// Only relevant for jsonb, array, and range columns.
@@ -472,33 +449,6 @@ public class PostgrestFilterBuilder: PostgrestTransformBuilder, @unchecked Senda
472
449
textSearch ( column, query: query, config: config, type: nil )
473
450
}
474
451
475
- @available ( * , deprecated, message: " Use textSearch(_:query:config:type) with .plain type. " )
476
- public func plfts(
477
- _ column: String ,
478
- query: any URLQueryRepresentable ,
479
- config: String ? = nil
480
- ) -> PostgrestFilterBuilder {
481
- textSearch ( column, query: query, config: config, type: . plain)
482
- }
483
-
484
- @available ( * , deprecated, message: " Use textSearch(_:query:config:type) with .phrase type. " )
485
- public func phfts(
486
- _ column: String ,
487
- query: any URLQueryRepresentable ,
488
- config: String ? = nil
489
- ) -> PostgrestFilterBuilder {
490
- textSearch ( column, query: query, config: config, type: . phrase)
491
- }
492
-
493
- @available ( * , deprecated, message: " Use textSearch(_:query:config:type) with .websearch type. " )
494
- public func wfts(
495
- _ column: String ,
496
- query: any URLQueryRepresentable ,
497
- config: String ? = nil
498
- ) -> PostgrestFilterBuilder {
499
- textSearch ( column, query: query, config: config, type: . websearch)
500
- }
501
-
502
452
/// Match only rows which satisfy the filter. This is an escape hatch - you should use the specific filter methods wherever possible.
503
453
///
504
454
/// Unlike most filters, `opearator` and `value` are used as-is and need to follow [PostgREST syntax](https://postgrest.org/en/stable/api.html#operators). You also need to make sure they are properly sanitized.
@@ -513,10 +463,11 @@ public class PostgrestFilterBuilder: PostgrestTransformBuilder, @unchecked Senda
513
463
value: String
514
464
) -> PostgrestFilterBuilder {
515
465
mutableState. withValue {
516
- $0. request. query. append ( URLQueryItem (
517
- name: column,
518
- value: " \( `operator`) . \( value) "
519
- ) )
466
+ $0. request. query. append (
467
+ URLQueryItem (
468
+ name: column,
469
+ value: " \( `operator`) . \( value) "
470
+ ) )
520
471
}
521
472
return self
522
473
}
@@ -530,10 +481,11 @@ public class PostgrestFilterBuilder: PostgrestTransformBuilder, @unchecked Senda
530
481
let query = query. mapValues ( \. queryValue)
531
482
mutableState. withValue { mutableState in
532
483
for (key, value) in query {
533
- mutableState. request. query. append ( URLQueryItem (
534
- name: key,
535
- value: " eq. \( value. queryValue) "
536
- ) )
484
+ mutableState. request. query. append (
485
+ URLQueryItem (
486
+ name: key,
487
+ value: " eq. \( value. queryValue) "
488
+ ) )
537
489
}
538
490
}
539
491
return self
0 commit comments