@@ -76,28 +76,28 @@ public extension Expression {
76
76
return FunctionExpression ( " array_concat " , exprs)
77
77
}
78
78
79
- func arrayContains( _ element: Expression ) -> BooleanExpr {
80
- return BooleanExpr ( " array_contains " , [ self , element] )
79
+ func arrayContains( _ element: Expression ) -> BooleanExpression {
80
+ return BooleanExpression ( " array_contains " , [ self , element] )
81
81
}
82
82
83
- func arrayContains( _ element: Sendable ) -> BooleanExpr {
84
- return BooleanExpr ( " array_contains " , [ self , Helper . sendableToExpr ( element) ] )
83
+ func arrayContains( _ element: Sendable ) -> BooleanExpression {
84
+ return BooleanExpression ( " array_contains " , [ self , Helper . sendableToExpr ( element) ] )
85
85
}
86
86
87
- func arrayContainsAll( _ values: [ Expression ] ) -> BooleanExpr {
88
- return BooleanExpr ( " array_contains_all " , [ self , Helper . array ( values) ] )
87
+ func arrayContainsAll( _ values: [ Expression ] ) -> BooleanExpression {
88
+ return BooleanExpression ( " array_contains_all " , [ self , Helper . array ( values) ] )
89
89
}
90
90
91
- func arrayContainsAll( _ values: [ Sendable ] ) -> BooleanExpr {
92
- return BooleanExpr ( " array_contains_all " , [ self , Helper . array ( values) ] )
91
+ func arrayContainsAll( _ values: [ Sendable ] ) -> BooleanExpression {
92
+ return BooleanExpression ( " array_contains_all " , [ self , Helper . array ( values) ] )
93
93
}
94
94
95
- func arrayContainsAny( _ values: [ Expression ] ) -> BooleanExpr {
96
- return BooleanExpr ( " array_contains_any " , [ self , Helper . array ( values) ] )
95
+ func arrayContainsAny( _ values: [ Expression ] ) -> BooleanExpression {
96
+ return BooleanExpression ( " array_contains_any " , [ self , Helper . array ( values) ] )
97
97
}
98
98
99
- func arrayContainsAny( _ values: [ Sendable ] ) -> BooleanExpr {
100
- return BooleanExpr ( " array_contains_any " , [ self , Helper . array ( values) ] )
99
+ func arrayContainsAny( _ values: [ Sendable ] ) -> BooleanExpression {
100
+ return BooleanExpression ( " array_contains_any " , [ self , Helper . array ( values) ] )
101
101
}
102
102
103
103
func arrayLength( ) -> FunctionExpression {
@@ -112,113 +112,113 @@ public extension Expression {
112
112
return FunctionExpression ( " array_get " , [ self , offsetExpr] )
113
113
}
114
114
115
- func gt( _ other: Expression ) -> BooleanExpr {
116
- return BooleanExpr ( " gt " , [ self , other] )
115
+ func gt( _ other: Expression ) -> BooleanExpression {
116
+ return BooleanExpression ( " gt " , [ self , other] )
117
117
}
118
118
119
- func gt( _ other: Sendable ) -> BooleanExpr {
119
+ func gt( _ other: Sendable ) -> BooleanExpression {
120
120
let exprOther = Helper . sendableToExpr ( other)
121
- return BooleanExpr ( " gt " , [ self , exprOther] )
121
+ return BooleanExpression ( " gt " , [ self , exprOther] )
122
122
}
123
123
124
124
// MARK: - Greater Than or Equal (gte)
125
125
126
- func gte( _ other: Expression ) -> BooleanExpr {
127
- return BooleanExpr ( " gte " , [ self , other] )
126
+ func gte( _ other: Expression ) -> BooleanExpression {
127
+ return BooleanExpression ( " gte " , [ self , other] )
128
128
}
129
129
130
- func gte( _ other: Sendable ) -> BooleanExpr {
130
+ func gte( _ other: Sendable ) -> BooleanExpression {
131
131
let exprOther = Helper . sendableToExpr ( other)
132
- return BooleanExpr ( " gte " , [ self , exprOther] )
132
+ return BooleanExpression ( " gte " , [ self , exprOther] )
133
133
}
134
134
135
135
// MARK: - Less Than (lt)
136
136
137
- func lt( _ other: Expression ) -> BooleanExpr {
138
- return BooleanExpr ( " lt " , [ self , other] )
137
+ func lt( _ other: Expression ) -> BooleanExpression {
138
+ return BooleanExpression ( " lt " , [ self , other] )
139
139
}
140
140
141
- func lt( _ other: Sendable ) -> BooleanExpr {
141
+ func lt( _ other: Sendable ) -> BooleanExpression {
142
142
let exprOther = Helper . sendableToExpr ( other)
143
- return BooleanExpr ( " lt " , [ self , exprOther] )
143
+ return BooleanExpression ( " lt " , [ self , exprOther] )
144
144
}
145
145
146
146
// MARK: - Less Than or Equal (lte)
147
147
148
- func lte( _ other: Expression ) -> BooleanExpr {
149
- return BooleanExpr ( " lte " , [ self , other] )
148
+ func lte( _ other: Expression ) -> BooleanExpression {
149
+ return BooleanExpression ( " lte " , [ self , other] )
150
150
}
151
151
152
- func lte( _ other: Sendable ) -> BooleanExpr {
152
+ func lte( _ other: Sendable ) -> BooleanExpression {
153
153
let exprOther = Helper . sendableToExpr ( other)
154
- return BooleanExpr ( " lte " , [ self , exprOther] )
154
+ return BooleanExpression ( " lte " , [ self , exprOther] )
155
155
}
156
156
157
157
// MARK: - Equal (eq)
158
158
159
- func eq( _ other: Expression ) -> BooleanExpr {
160
- return BooleanExpr ( " eq " , [ self , other] )
159
+ func eq( _ other: Expression ) -> BooleanExpression {
160
+ return BooleanExpression ( " eq " , [ self , other] )
161
161
}
162
162
163
- func eq( _ other: Sendable ) -> BooleanExpr {
163
+ func eq( _ other: Sendable ) -> BooleanExpression {
164
164
let exprOther = Helper . sendableToExpr ( other)
165
- return BooleanExpr ( " eq " , [ self , exprOther] )
165
+ return BooleanExpression ( " eq " , [ self , exprOther] )
166
166
}
167
167
168
- func neq( _ other: Expression ) -> BooleanExpr {
169
- return BooleanExpr ( " neq " , [ self , other] )
168
+ func neq( _ other: Expression ) -> BooleanExpression {
169
+ return BooleanExpression ( " neq " , [ self , other] )
170
170
}
171
171
172
- func neq( _ other: Sendable ) -> BooleanExpr {
173
- return BooleanExpr ( " neq " , [ self , Helper . sendableToExpr ( other) ] )
172
+ func neq( _ other: Sendable ) -> BooleanExpression {
173
+ return BooleanExpression ( " neq " , [ self , Helper . sendableToExpr ( other) ] )
174
174
}
175
175
176
- func eqAny( _ others: [ Expression ] ) -> BooleanExpr {
177
- return BooleanExpr ( " eq_any " , [ self , Helper . array ( others) ] )
176
+ func eqAny( _ others: [ Expression ] ) -> BooleanExpression {
177
+ return BooleanExpression ( " eq_any " , [ self , Helper . array ( others) ] )
178
178
}
179
179
180
- func eqAny( _ others: [ Sendable ] ) -> BooleanExpr {
181
- return BooleanExpr ( " eq_any " , [ self , Helper . array ( others) ] )
180
+ func eqAny( _ others: [ Sendable ] ) -> BooleanExpression {
181
+ return BooleanExpression ( " eq_any " , [ self , Helper . array ( others) ] )
182
182
}
183
183
184
- func notEqAny( _ others: [ Expression ] ) -> BooleanExpr {
185
- return BooleanExpr ( " not_eq_any " , [ self , Helper . array ( others) ] )
184
+ func notEqAny( _ others: [ Expression ] ) -> BooleanExpression {
185
+ return BooleanExpression ( " not_eq_any " , [ self , Helper . array ( others) ] )
186
186
}
187
187
188
- func notEqAny( _ others: [ Sendable ] ) -> BooleanExpr {
189
- return BooleanExpr ( " not_eq_any " , [ self , Helper . array ( others) ] )
188
+ func notEqAny( _ others: [ Sendable ] ) -> BooleanExpression {
189
+ return BooleanExpression ( " not_eq_any " , [ self , Helper . array ( others) ] )
190
190
}
191
191
192
192
// MARK: Checks
193
193
194
194
// --- Added Type Check Operations ---
195
195
196
- func isNan( ) -> BooleanExpr {
197
- return BooleanExpr ( " is_nan " , [ self ] )
196
+ func isNan( ) -> BooleanExpression {
197
+ return BooleanExpression ( " is_nan " , [ self ] )
198
198
}
199
199
200
- func isNil( ) -> BooleanExpr {
201
- return BooleanExpr ( " is_null " , [ self ] )
200
+ func isNil( ) -> BooleanExpression {
201
+ return BooleanExpression ( " is_null " , [ self ] )
202
202
}
203
203
204
- func exists( ) -> BooleanExpr {
205
- return BooleanExpr ( " exists " , [ self ] )
204
+ func exists( ) -> BooleanExpression {
205
+ return BooleanExpression ( " exists " , [ self ] )
206
206
}
207
207
208
- func isError( ) -> BooleanExpr {
209
- return BooleanExpr ( " is_error " , [ self ] )
208
+ func isError( ) -> BooleanExpression {
209
+ return BooleanExpression ( " is_error " , [ self ] )
210
210
}
211
211
212
- func isAbsent( ) -> BooleanExpr {
213
- return BooleanExpr ( " is_absent " , [ self ] )
212
+ func isAbsent( ) -> BooleanExpression {
213
+ return BooleanExpression ( " is_absent " , [ self ] )
214
214
}
215
215
216
- func isNotNil( ) -> BooleanExpr {
217
- return BooleanExpr ( " is_not_null " , [ self ] )
216
+ func isNotNil( ) -> BooleanExpression {
217
+ return BooleanExpression ( " is_not_null " , [ self ] )
218
218
}
219
219
220
- func isNotNan( ) -> BooleanExpr {
221
- return BooleanExpr ( " is_not_nan " , [ self ] )
220
+ func isNotNan( ) -> BooleanExpression {
221
+ return BooleanExpression ( " is_not_nan " , [ self ] )
222
222
}
223
223
224
224
// --- Added String Operations ---
@@ -227,52 +227,52 @@ public extension Expression {
227
227
return FunctionExpression ( " char_length " , [ self ] )
228
228
}
229
229
230
- func like( _ pattern: String ) -> BooleanExpr {
231
- return BooleanExpr ( " like " , [ self , Helper . sendableToExpr ( pattern) ] )
230
+ func like( _ pattern: String ) -> BooleanExpression {
231
+ return BooleanExpression ( " like " , [ self , Helper . sendableToExpr ( pattern) ] )
232
232
}
233
233
234
- func like( _ pattern: Expression ) -> BooleanExpr {
235
- return BooleanExpr ( " like " , [ self , pattern] )
234
+ func like( _ pattern: Expression ) -> BooleanExpression {
235
+ return BooleanExpression ( " like " , [ self , pattern] )
236
236
}
237
237
238
- func regexContains( _ pattern: String ) -> BooleanExpr {
239
- return BooleanExpr ( " regex_contains " , [ self , Helper . sendableToExpr ( pattern) ] )
238
+ func regexContains( _ pattern: String ) -> BooleanExpression {
239
+ return BooleanExpression ( " regex_contains " , [ self , Helper . sendableToExpr ( pattern) ] )
240
240
}
241
241
242
- func regexContains( _ pattern: Expression ) -> BooleanExpr {
243
- return BooleanExpr ( " regex_contains " , [ self , pattern] )
242
+ func regexContains( _ pattern: Expression ) -> BooleanExpression {
243
+ return BooleanExpression ( " regex_contains " , [ self , pattern] )
244
244
}
245
245
246
- func regexMatch( _ pattern: String ) -> BooleanExpr {
247
- return BooleanExpr ( " regex_match " , [ self , Helper . sendableToExpr ( pattern) ] )
246
+ func regexMatch( _ pattern: String ) -> BooleanExpression {
247
+ return BooleanExpression ( " regex_match " , [ self , Helper . sendableToExpr ( pattern) ] )
248
248
}
249
249
250
- func regexMatch( _ pattern: Expression ) -> BooleanExpr {
251
- return BooleanExpr ( " regex_match " , [ self , pattern] )
250
+ func regexMatch( _ pattern: Expression ) -> BooleanExpression {
251
+ return BooleanExpression ( " regex_match " , [ self , pattern] )
252
252
}
253
253
254
- func strContains( _ substring: String ) -> BooleanExpr {
255
- return BooleanExpr ( " str_contains " , [ self , Helper . sendableToExpr ( substring) ] )
254
+ func strContains( _ substring: String ) -> BooleanExpression {
255
+ return BooleanExpression ( " str_contains " , [ self , Helper . sendableToExpr ( substring) ] )
256
256
}
257
257
258
- func strContains( _ expr: Expression ) -> BooleanExpr {
259
- return BooleanExpr ( " str_contains " , [ self , expr] )
258
+ func strContains( _ expr: Expression ) -> BooleanExpression {
259
+ return BooleanExpression ( " str_contains " , [ self , expr] )
260
260
}
261
261
262
- func startsWith( _ prefix: String ) -> BooleanExpr {
263
- return BooleanExpr ( " starts_with " , [ self , Helper . sendableToExpr ( prefix) ] )
262
+ func startsWith( _ prefix: String ) -> BooleanExpression {
263
+ return BooleanExpression ( " starts_with " , [ self , Helper . sendableToExpr ( prefix) ] )
264
264
}
265
265
266
- func startsWith( _ prefix: Expression ) -> BooleanExpr {
267
- return BooleanExpr ( " starts_with " , [ self , prefix] )
266
+ func startsWith( _ prefix: Expression ) -> BooleanExpression {
267
+ return BooleanExpression ( " starts_with " , [ self , prefix] )
268
268
}
269
269
270
- func endsWith( _ suffix: String ) -> BooleanExpr {
271
- return BooleanExpr ( " ends_with " , [ self , Helper . sendableToExpr ( suffix) ] )
270
+ func endsWith( _ suffix: String ) -> BooleanExpression {
271
+ return BooleanExpression ( " ends_with " , [ self , Helper . sendableToExpr ( suffix) ] )
272
272
}
273
273
274
- func endsWith( _ suffix: Expression ) -> BooleanExpr {
275
- return BooleanExpr ( " ends_with " , [ self , suffix] )
274
+ func endsWith( _ suffix: Expression ) -> BooleanExpression {
275
+ return BooleanExpression ( " ends_with " , [ self , suffix] )
276
276
}
277
277
278
278
func lowercased( ) -> FunctionExpression {
@@ -300,33 +300,33 @@ public extension Expression {
300
300
return FunctionExpression ( " reverse " , [ self ] )
301
301
}
302
302
303
- func replaceFirst( _ find: String , _ replace: String ) -> FunctionExpression {
303
+ func replaceFirst( _ find: String , with replace: String ) -> FunctionExpression {
304
304
return FunctionExpression (
305
305
" replace_first " ,
306
306
[ self , Helper . sendableToExpr ( find) , Helper . sendableToExpr ( replace) ]
307
307
)
308
308
}
309
309
310
- func replaceFirst( _ find: Expression , _ replace: Expression ) -> FunctionExpression {
310
+ func replaceFirst( _ find: Expression , with replace: Expression ) -> FunctionExpression {
311
311
return FunctionExpression ( " replace_first " , [ self , find, replace] )
312
312
}
313
313
314
- func replaceAll( _ find: String , _ replace: String ) -> FunctionExpression {
314
+ func replaceAll( _ find: String , with replace: String ) -> FunctionExpression {
315
315
return FunctionExpression (
316
316
" replace_all " ,
317
317
[ self , Helper . sendableToExpr ( find) , Helper . sendableToExpr ( replace) ]
318
318
)
319
319
}
320
320
321
- func replaceAll( _ find: Expression , _ replace: Expression ) -> FunctionExpression {
321
+ func replaceAll( _ find: Expression , with replace: Expression ) -> FunctionExpression {
322
322
return FunctionExpression ( " replace_all " , [ self , find, replace] )
323
323
}
324
324
325
325
func byteLength( ) -> FunctionExpression {
326
326
return FunctionExpression ( " byte_length " , [ self ] )
327
327
}
328
328
329
- func substr( _ position: Int , _ length: Int ? = nil ) -> FunctionExpression {
329
+ func substr( position: Int , length: Int ? = nil ) -> FunctionExpression {
330
330
let positionExpr = Helper . sendableToExpr ( position)
331
331
if let length = length {
332
332
return FunctionExpression ( " substr " , [ self , positionExpr, Helper . sendableToExpr ( length) ] )
@@ -335,7 +335,7 @@ public extension Expression {
335
335
}
336
336
}
337
337
338
- func substr( _ position: Expression , _ length: Expression ? = nil ) -> FunctionExpression {
338
+ func substr( position: Expression , length: Expression ? = nil ) -> FunctionExpression {
339
339
if let length = length {
340
340
return FunctionExpression ( " substr " , [ self , position, length] )
341
341
} else {
@@ -488,22 +488,22 @@ public extension Expression {
488
488
return FunctionExpression ( " timestamp_to_unix_seconds " , [ self ] )
489
489
}
490
490
491
- func timestampAdd( _ unit : Expression , _ amount : Expression ) -> FunctionExpression {
491
+ func timestampAdd( amount : Expression , unit : Expression ) -> FunctionExpression {
492
492
return FunctionExpression ( " timestamp_add " , [ self , unit, amount] )
493
493
}
494
494
495
- func timestampAdd( _ unit : TimeUnit , _ amount : Int ) -> FunctionExpression {
495
+ func timestampAdd( _ amount : Int , _ unit : TimeUnit ) -> FunctionExpression {
496
496
return FunctionExpression (
497
497
" timestamp_add " ,
498
498
[ self , Helper . sendableToExpr ( unit) , Helper . sendableToExpr ( amount) ]
499
499
)
500
500
}
501
501
502
- func timestampSub( _ unit : Expression , _ amount : Expression ) -> FunctionExpression {
502
+ func timestampSub( amount : Expression , unit : Expression ) -> FunctionExpression {
503
503
return FunctionExpression ( " timestamp_sub " , [ self , unit, amount] )
504
504
}
505
505
506
- func timestampSub( _ unit : TimeUnit , _ amount : Int ) -> FunctionExpression {
506
+ func timestampSub( _ amount : Int , _ unit : TimeUnit ) -> FunctionExpression {
507
507
return FunctionExpression (
508
508
" timestamp_sub " ,
509
509
[ self , Helper . sendableToExpr ( unit) , Helper . sendableToExpr ( amount) ]
0 commit comments