@@ -77,16 +77,16 @@ final class BuildURLRequestTests: XCTestCase {
77
77
78
78
let testCases : [ TestCase ] = [
79
79
TestCase ( name: " select all users where email ends with '@supabase.co' " ) { client in
80
- await client. from ( " users " )
80
+ client. from ( " users " )
81
81
. select ( )
82
82
. like ( " email " , value: " %@supabase.co " )
83
83
} ,
84
84
TestCase ( name: " insert new user " ) { client in
85
- try await client. from ( " users " )
85
+ try client. from ( " users " )
86
86
. insert ( User ( email
: " [email protected] " ) )
87
87
} ,
88
88
TestCase ( name: " bulk insert users " ) { client in
89
- try await client. from ( " users " )
89
+ try client. from ( " users " )
90
90
. insert (
91
91
[
92
92
@@ -95,16 +95,16 @@ final class BuildURLRequestTests: XCTestCase {
95
95
)
96
96
} ,
97
97
TestCase ( name: " call rpc " ) { client in
98
- try await client. rpc ( " test_fcn " , params: [ " KEY " : " VALUE " ] )
98
+ try client. rpc ( " test_fcn " , params: [ " KEY " : " VALUE " ] )
99
99
} ,
100
100
TestCase ( name: " call rpc without parameter " ) { client in
101
- try await client. rpc ( " test_fcn " )
101
+ try client. rpc ( " test_fcn " )
102
102
} ,
103
103
TestCase ( name: " call rpc with filter " ) { client in
104
- try await client. rpc ( " test_fcn " ) . eq ( " id " , value: 1 )
104
+ try client. rpc ( " test_fcn " ) . eq ( " id " , value: 1 )
105
105
} ,
106
106
TestCase ( name: " test all filters and count " ) { client in
107
- var query = await client. from ( " todos " ) . select ( )
107
+ var query = client. from ( " todos " ) . select ( )
108
108
109
109
for op in PostgrestFilterBuilder . Operator. allCases {
110
110
query = query. filter ( " column " , operator: op, value: " Some value " )
@@ -113,28 +113,28 @@ final class BuildURLRequestTests: XCTestCase {
113
113
return query
114
114
} ,
115
115
TestCase ( name: " test in filter " ) { client in
116
- await client. from ( " todos " ) . select ( ) . in ( " id " , value: [ 1 , 2 , 3 ] )
116
+ client. from ( " todos " ) . select ( ) . in ( " id " , value: [ 1 , 2 , 3 ] )
117
117
} ,
118
118
TestCase ( name: " test contains filter with dictionary " ) { client in
119
- await client. from ( " users " ) . select ( " name " )
119
+ client. from ( " users " ) . select ( " name " )
120
120
. contains ( " address " , value: [ " postcode " : 90210 ] )
121
121
} ,
122
122
TestCase ( name: " test contains filter with array " ) { client in
123
- await client. from ( " users " )
123
+ client. from ( " users " )
124
124
. select ( )
125
125
. contains ( " name " , value: [ " is:online " , " faction:red " ] )
126
126
} ,
127
127
TestCase ( name: " test or filter with referenced table " ) { client in
128
- await client. from ( " users " )
128
+ client. from ( " users " )
129
129
. select ( " *, messages(*) " )
130
130
. or ( " public.eq.true,recipient_id.eq.1 " , referencedTable: " messages " )
131
131
} ,
132
132
TestCase ( name: " test upsert not ignoring duplicates " ) { client in
133
- try await client. from ( " users " )
133
+ try client. from ( " users " )
134
134
. upsert ( User ( email
: " [email protected] " ) )
135
135
} ,
136
136
TestCase ( name: " bulk upsert " ) { client in
137
- try await client. from ( " users " )
137
+ try client. from ( " users " )
138
138
. upsert (
139
139
[
140
140
@@ -143,27 +143,27 @@ final class BuildURLRequestTests: XCTestCase {
143
143
)
144
144
} ,
145
145
TestCase ( name: " test upsert ignoring duplicates " ) { client in
146
- try await client. from ( " users " )
146
+ try client. from ( " users " )
147
147
. upsert ( User ( email
: " [email protected] " ) , ignoreDuplicates
: true )
148
148
} ,
149
149
TestCase ( name: " query with + character " ) { client in
150
- await client. from ( " users " )
150
+ client. from ( " users " )
151
151
. select ( )
152
152
. eq ( " id " , value: " Cigányka-ér (0+400 cskm) vízrajzi állomás " )
153
153
} ,
154
154
TestCase ( name: " query with timestampz " ) { client in
155
- await client. from ( " tasks " )
155
+ client. from ( " tasks " )
156
156
. select ( )
157
157
. gt ( " received_at " , value: " 2023-03-23T15:50:30.511743+00:00 " )
158
158
. order ( " received_at " )
159
159
} ,
160
160
TestCase ( name: " query non-default schema " ) { client in
161
- await client. schema ( " storage " )
161
+ client. schema ( " storage " )
162
162
. from ( " objects " )
163
163
. select ( )
164
164
} ,
165
165
TestCase ( name: " select after an insert " ) { client in
166
- try await client. from ( " users " )
166
+ try client. from ( " users " )
167
167
. insert ( User ( email
: " [email protected] " ) )
168
168
. select ( " id,email " )
169
169
} ,
@@ -176,9 +176,9 @@ final class BuildURLRequestTests: XCTestCase {
176
176
}
177
177
}
178
178
179
- func testSessionConfiguration( ) async {
179
+ func testSessionConfiguration( ) {
180
180
let client = PostgrestClient ( url: url, schema: nil , logger: nil )
181
- let clientInfoHeader = await client. configuration. headers [ " X-Client-Info " ]
181
+ let clientInfoHeader = client. configuration. headers [ " X-Client-Info " ]
182
182
XCTAssertNotNil ( clientInfoHeader)
183
183
}
184
184
}
0 commit comments