@@ -14,14 +14,15 @@ final class PostgrestFilterTests: XCTestCase {
1414 configuration: PostgrestClient . Configuration (
1515 url: URL ( string: " \( DotEnv . SUPABASE_URL) /rest/v1 " ) !,
1616 headers: [
17- " apikey " : DotEnv . SUPABASE_ANON_KEY,
17+ " apikey " : DotEnv . SUPABASE_ANON_KEY
1818 ] ,
1919 logger: nil
2020 )
2121 )
2222
2323 func testNot( ) async throws {
24- let res = try await client. from ( " users " )
24+ let res =
25+ try await client. from ( " users " )
2526 . select ( " status " )
2627 . not ( " status " , operator: . eq, value: " OFFLINE " )
2728 . execute ( )
@@ -44,7 +45,8 @@ final class PostgrestFilterTests: XCTestCase {
4445 }
4546
4647 func testOr( ) async throws {
47- let res = try await client. from ( " users " )
48+ let res =
49+ try await client. from ( " users " )
4850 . select ( " status,username " )
4951 . or ( " status.eq.OFFLINE,username.eq.supabot " )
5052 . execute ( )
@@ -66,7 +68,8 @@ final class PostgrestFilterTests: XCTestCase {
6668 }
6769
6870 func testEq( ) async throws {
69- let res = try await client. from ( " users " )
71+ let res =
72+ try await client. from ( " users " )
7073 . select ( " username " )
7174 . eq ( " username " , value: " supabot " )
7275 . execute ( )
@@ -83,7 +86,8 @@ final class PostgrestFilterTests: XCTestCase {
8386 }
8487
8588 func testNeq( ) async throws {
86- let res = try await client. from ( " users " )
89+ let res =
90+ try await client. from ( " users " )
8791 . select ( " username " )
8892 . neq ( " username " , value: " supabot " )
8993 . execute ( )
@@ -106,7 +110,8 @@ final class PostgrestFilterTests: XCTestCase {
106110 }
107111
108112 func testGt( ) async throws {
109- let res = try await client. from ( " messages " )
113+ let res =
114+ try await client. from ( " messages " )
110115 . select ( " id " )
111116 . gt ( " id " , value: 1 )
112117 . execute ( )
@@ -123,7 +128,8 @@ final class PostgrestFilterTests: XCTestCase {
123128 }
124129
125130 func testGte( ) async throws {
126- let res = try await client. from ( " messages " )
131+ let res =
132+ try await client. from ( " messages " )
127133 . select ( " id " )
128134 . gte ( " id " , value: 1 )
129135 . execute ( )
@@ -143,7 +149,8 @@ final class PostgrestFilterTests: XCTestCase {
143149 }
144150
145151 func testLe( ) async throws {
146- let res = try await client. from ( " messages " )
152+ let res =
153+ try await client. from ( " messages " )
147154 . select ( " id " )
148155 . lt ( " id " , value: 2 )
149156 . execute ( )
@@ -160,7 +167,8 @@ final class PostgrestFilterTests: XCTestCase {
160167 }
161168
162169 func testLte( ) async throws {
163- let res = try await client. from ( " messages " )
170+ let res =
171+ try await client. from ( " messages " )
164172 . select ( " id " )
165173 . lte ( " id " , value: 2 )
166174 . execute ( )
@@ -180,7 +188,8 @@ final class PostgrestFilterTests: XCTestCase {
180188 }
181189
182190 func testLike( ) async throws {
183- let res = try await client. from ( " users " )
191+ let res =
192+ try await client. from ( " users " )
184193 . select ( " username " )
185194 . like ( " username " , pattern: " %supa% " )
186195 . execute ( )
@@ -197,7 +206,8 @@ final class PostgrestFilterTests: XCTestCase {
197206 }
198207
199208 func testLikeAllOf( ) async throws {
200- let res = try await client. from ( " users " )
209+ let res =
210+ try await client. from ( " users " )
201211 . select ( " username " )
202212 . likeAllOf ( " username " , patterns: [ " %supa% " , " %bot% " ] )
203213 . execute ( )
@@ -214,7 +224,8 @@ final class PostgrestFilterTests: XCTestCase {
214224 }
215225
216226 func testLikeAnyOf( ) async throws {
217- let res = try await client. from ( " users " )
227+ let res =
228+ try await client. from ( " users " )
218229 . select ( " username " )
219230 . likeAnyOf ( " username " , patterns: [ " %supa% " , " %kiwi% " ] )
220231 . execute ( )
@@ -234,7 +245,8 @@ final class PostgrestFilterTests: XCTestCase {
234245 }
235246
236247 func testIlike( ) async throws {
237- let res = try await client. from ( " users " )
248+ let res =
249+ try await client. from ( " users " )
238250 . select ( " username " )
239251 . ilike ( " username " , pattern: " %SUPA% " )
240252 . execute ( )
@@ -251,7 +263,8 @@ final class PostgrestFilterTests: XCTestCase {
251263 }
252264
253265 func testIlikeAllOf( ) async throws {
254- let res = try await client. from ( " users " )
266+ let res =
267+ try await client. from ( " users " )
255268 . select ( " username " )
256269 . iLikeAllOf ( " username " , patterns: [ " %SUPA% " , " %bot% " ] )
257270 . execute ( )
@@ -268,7 +281,8 @@ final class PostgrestFilterTests: XCTestCase {
268281 }
269282
270283 func testIlikeAnyOf( ) async throws {
271- let res = try await client. from ( " users " )
284+ let res =
285+ try await client. from ( " users " )
272286 . select ( " username " )
273287 . iLikeAnyOf ( " username " , patterns: [ " %supa% " , " %KIWI% " ] )
274288 . execute ( )
@@ -288,7 +302,8 @@ final class PostgrestFilterTests: XCTestCase {
288302 }
289303
290304 func testIs( ) async throws {
291- let res = try await client. from ( " users " ) . select ( " data " ) . is ( " data " , value: nil )
305+ let res =
306+ try await client. from ( " users " ) . select ( " data " ) . is ( " data " , value: nil )
292307 . execute ( )
293308 . value as AnyJSON
294309
@@ -314,7 +329,8 @@ final class PostgrestFilterTests: XCTestCase {
314329
315330 func testIn( ) async throws {
316331 let statuses = [ " ONLINE " , " OFFLINE " ]
317- let res = try await client. from ( " users " ) . select ( " status " ) . in ( " status " , values: statuses)
332+ let res =
333+ try await client. from ( " users " ) . select ( " status " ) . in ( " status " , values: statuses)
318334 . execute ( )
319335 . value as AnyJSON
320336
@@ -339,7 +355,8 @@ final class PostgrestFilterTests: XCTestCase {
339355 }
340356
341357 func testContains( ) async throws {
342- let res = try await client. from ( " users " ) . select ( " age_range " ) . contains ( " age_range " , value: " [1,2) " )
358+ let res =
359+ try await client. from ( " users " ) . select ( " age_range " ) . contains ( " age_range " , value: " [1,2) " )
343360 . execute ( )
344361 . value as AnyJSON
345362
@@ -355,7 +372,8 @@ final class PostgrestFilterTests: XCTestCase {
355372 }
356373
357374 func testContainedBy( ) async throws {
358- let res = try await client. from ( " users " ) . select ( " age_range " ) . containedBy ( " age_range " , value: " [1,2) " )
375+ let res =
376+ try await client. from ( " users " ) . select ( " age_range " ) . containedBy ( " age_range " , value: " [1,2) " )
359377 . execute ( )
360378 . value as AnyJSON
361379
@@ -371,7 +389,8 @@ final class PostgrestFilterTests: XCTestCase {
371389 }
372390
373391 func testRangeLt( ) async throws {
374- let res = try await client. from ( " users " ) . select ( " age_range " ) . rangeLt ( " age_range " , range: " [2,25) " )
392+ let res =
393+ try await client. from ( " users " ) . select ( " age_range " ) . rangeLt ( " age_range " , range: " [2,25) " )
375394 . execute ( )
376395 . value as AnyJSON
377396
@@ -387,7 +406,8 @@ final class PostgrestFilterTests: XCTestCase {
387406 }
388407
389408 func testRangeGt( ) async throws {
390- let res = try await client. from ( " users " ) . select ( " age_range " ) . rangeGt ( " age_range " , range: " [2,25) " )
409+ let res =
410+ try await client. from ( " users " ) . select ( " age_range " ) . rangeGt ( " age_range " , range: " [2,25) " )
391411 . execute ( )
392412 . value as AnyJSON
393413
@@ -406,7 +426,8 @@ final class PostgrestFilterTests: XCTestCase {
406426 }
407427
408428 func testRangeLte( ) async throws {
409- let res = try await client. from ( " users " ) . select ( " age_range " ) . rangeLte ( " age_range " , range: " [2,25) " )
429+ let res =
430+ try await client. from ( " users " ) . select ( " age_range " ) . rangeLte ( " age_range " , range: " [2,25) " )
410431 . execute ( )
411432 . value as AnyJSON
412433
@@ -422,7 +443,8 @@ final class PostgrestFilterTests: XCTestCase {
422443 }
423444
424445 func testRangeGte( ) async throws {
425- let res = try await client. from ( " users " ) . select ( " age_range " ) . rangeGte ( " age_range " , range: " [2,25) " )
446+ let res =
447+ try await client. from ( " users " ) . select ( " age_range " ) . rangeGte ( " age_range " , range: " [2,25) " )
426448 . execute ( )
427449 . value as AnyJSON
428450
@@ -444,7 +466,8 @@ final class PostgrestFilterTests: XCTestCase {
444466 }
445467
446468 func testRangeAdjacent( ) async throws {
447- let res = try await client. from ( " users " ) . select ( " age_range " ) . rangeAdjacent ( " age_range " , range: " [2,25) " )
469+ let res =
470+ try await client. from ( " users " ) . select ( " age_range " ) . rangeAdjacent ( " age_range " , range: " [2,25) " )
448471 . execute ( )
449472 . value as AnyJSON
450473
@@ -466,7 +489,8 @@ final class PostgrestFilterTests: XCTestCase {
466489 }
467490
468491 func testOverlaps( ) async throws {
469- let res = try await client. from ( " users " ) . select ( " age_range " ) . overlaps ( " age_range " , value: " [2,25) " )
492+ let res =
493+ try await client. from ( " users " ) . select ( " age_range " ) . overlaps ( " age_range " , value: " [2,25) " )
470494 . execute ( )
471495 . value as AnyJSON
472496
@@ -482,7 +506,8 @@ final class PostgrestFilterTests: XCTestCase {
482506 }
483507
484508 func testTextSearch( ) async throws {
485- let res = try await client. from ( " users " ) . select ( " catchphrase " )
509+ let res =
510+ try await client. from ( " users " ) . select ( " catchphrase " )
486511 . textSearch ( " catchphrase " , query: " 'fat' & 'cat' " , config: " english " )
487512 . execute ( )
488513 . value as AnyJSON
@@ -499,7 +524,8 @@ final class PostgrestFilterTests: XCTestCase {
499524 }
500525
501526 func testTextSearchWithPlain( ) async throws {
502- let res = try await client. from ( " users " ) . select ( " catchphrase " )
527+ let res =
528+ try await client. from ( " users " ) . select ( " catchphrase " )
503529 . textSearch ( " catchphrase " , query: " 'fat' & 'cat' " , config: " english " , type: . plain)
504530 . execute ( )
505531 . value as AnyJSON
@@ -516,7 +542,8 @@ final class PostgrestFilterTests: XCTestCase {
516542 }
517543
518544 func testTextSearchWithPhrase( ) async throws {
519- let res = try await client. from ( " users " ) . select ( " catchphrase " )
545+ let res =
546+ try await client. from ( " users " ) . select ( " catchphrase " )
520547 . textSearch ( " catchphrase " , query: " cat " , config: " english " , type: . phrase)
521548 . execute ( )
522549 . value as AnyJSON
@@ -536,7 +563,8 @@ final class PostgrestFilterTests: XCTestCase {
536563 }
537564
538565 func testTextSearchWithWebsearch( ) async throws {
539- let res = try await client. from ( " users " ) . select ( " catchphrase " )
566+ let res =
567+ try await client. from ( " users " ) . select ( " catchphrase " )
540568 . textSearch ( " catchphrase " , query: " 'fat' & 'cat' " , config: " english " , type: . websearch)
541569 . execute ( )
542570 . value as AnyJSON
@@ -553,7 +581,8 @@ final class PostgrestFilterTests: XCTestCase {
553581 }
554582
555583 func testMultipleFilters( ) async throws {
556- let res = try await client. from ( " users " )
584+ let res =
585+ try await client. from ( " users " )
557586 . select ( )
558587 . eq ( " username " , value: " supabot " )
559588 . is ( " data " , value: nil )
@@ -579,7 +608,8 @@ final class PostgrestFilterTests: XCTestCase {
579608 }
580609
581610 func testFilter( ) async throws {
582- let res = try await client. from ( " users " )
611+ let res =
612+ try await client. from ( " users " )
583613 . select ( " username " )
584614 . filter ( " username " , operator: " eq " , value: " supabot " )
585615 . execute ( )
@@ -597,7 +627,8 @@ final class PostgrestFilterTests: XCTestCase {
597627 }
598628
599629 func testMatch( ) async throws {
600- let res = try await client. from ( " users " )
630+ let res =
631+ try await client. from ( " users " )
601632 . select ( " username,status " )
602633 . match ( [ " username " : " supabot " , " status " : " ONLINE " ] )
603634 . execute ( )
@@ -616,7 +647,8 @@ final class PostgrestFilterTests: XCTestCase {
616647 }
617648
618649 func testFilterOnRpc( ) async throws {
619- let res = try await client. rpc ( " get_username_and_status " , params: [ " name_param " : " supabot " ] )
650+ let res =
651+ try await client. rpc ( " get_username_and_status " , params: [ " name_param " : " supabot " ] )
620652 . neq ( " status " , value: " ONLINE " )
621653 . execute ( )
622654 . value as AnyJSON
0 commit comments