@@ -4,7 +4,7 @@ import Helpers
44public class PostgrestFilterBuilder : PostgrestTransformBuilder , @unchecked Sendable {
55 public enum Operator : String , CaseIterable , Sendable {
66 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
88 }
99
1010 // MARK: - Filters
@@ -17,10 +17,11 @@ public class PostgrestFilterBuilder: PostgrestTransformBuilder, @unchecked Senda
1717 let queryValue = value. queryValue
1818
1919 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+ ) )
2425 }
2526
2627 return self
@@ -152,14 +153,6 @@ public class PostgrestFilterBuilder: PostgrestTransformBuilder, @unchecked Senda
152153 return self
153154 }
154155
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-
163156 /// Match only rows where `column` matches all of `patterns` case-sensitively.
164157 /// - Parameters:
165158 /// - column: The column to filter on
@@ -206,14 +199,6 @@ public class PostgrestFilterBuilder: PostgrestTransformBuilder, @unchecked Senda
206199 return self
207200 }
208201
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-
217202 /// Match only rows where `column` matches all of `patterns` case-insensitively.
218203 /// - Parameters:
219204 /// - column: The column to filter on
@@ -284,14 +269,6 @@ public class PostgrestFilterBuilder: PostgrestTransformBuilder, @unchecked Senda
284269 return self
285270 }
286271
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-
295272 /// Match only rows where `column` contains every element appearing in `value`.
296273 ///
297274 /// Only relevant for jsonb, array, and range columns.
@@ -472,33 +449,6 @@ public class PostgrestFilterBuilder: PostgrestTransformBuilder, @unchecked Senda
472449 textSearch ( column, query: query, config: config, type: nil )
473450 }
474451
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-
502452 /// Match only rows which satisfy the filter. This is an escape hatch - you should use the specific filter methods wherever possible.
503453 ///
504454 /// 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
513463 value: String
514464 ) -> PostgrestFilterBuilder {
515465 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+ ) )
520471 }
521472 return self
522473 }
@@ -530,10 +481,11 @@ public class PostgrestFilterBuilder: PostgrestTransformBuilder, @unchecked Senda
530481 let query = query. mapValues ( \. queryValue)
531482 mutableState. withValue { mutableState in
532483 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+ ) )
537489 }
538490 }
539491 return self
0 commit comments