@@ -332,39 +332,89 @@ public protocol Expression: Sendable {
332
332
/// - Returns: A new `FunctionExpression` representing the "arrayGet" operation.
333
333
func arrayGet( _ offsetExpr: Expression ) -> FunctionExpression
334
334
335
- func gt( _ other: Expression ) -> BooleanExpression
336
-
337
- func gt( _ other: Sendable ) -> BooleanExpression
338
-
339
- // MARK: - Greater Than or Equal (gte)
340
-
341
- func gte( _ other: Expression ) -> BooleanExpression
342
-
343
- func gte( _ other: Sendable ) -> BooleanExpression
344
-
345
- // MARK: - Less Than (lt)
335
+ /// Creates a `BooleanExpr` that returns `true` if this expression is greater
336
+ /// than the given expression.
337
+ ///
338
+ /// - Parameter other: The expression to compare against.
339
+ /// - Returns: A `BooleanExpr` that can be used in `where` clauses.
340
+ func greaterThan( _ other: Expression ) -> BooleanExpression
346
341
347
- func lt( _ other: Expression ) -> BooleanExpression
342
+ /// Creates a `BooleanExpr` that returns `true` if this expression is greater
343
+ /// than the given value.
344
+ ///
345
+ /// - Parameter other: The value to compare against.
346
+ /// - Returns: A `BooleanExpr` that can be used in `where` clauses.
347
+ func greaterThan( _ other: Sendable ) -> BooleanExpression
348
348
349
- func lt( _ other: Sendable ) -> BooleanExpression
349
+ /// Creates a `BooleanExpr` that returns `true` if this expression is
350
+ /// greater than or equal to the given expression.
351
+ ///
352
+ /// - Parameter other: The expression to compare against.
353
+ /// - Returns: A `BooleanExpr` that can be used in `where` clauses.
354
+ func greaterThanOrEqualTo( _ other: Expression ) -> BooleanExpression
350
355
351
- // MARK: - Less Than or Equal (lte)
356
+ /// Creates a `BooleanExpr` that returns `true` if this expression is
357
+ /// greater than or equal to the given value.
358
+ ///
359
+ /// - Parameter other: The value to compare against.
360
+ /// - Returns: A `BooleanExpr` that can be used in `where` clauses.
361
+ func greaterThanOrEqualTo( _ other: Sendable ) -> BooleanExpression
352
362
353
- func lte( _ other: Expression ) -> BooleanExpression
363
+ /// Creates a `BooleanExpr` that returns `true` if this expression is less
364
+ /// than the given expression.
365
+ ///
366
+ /// - Parameter other: The expression to compare against.
367
+ /// - Returns: A `BooleanExpr` that can be used in `where` clauses.
368
+ func lessThan( _ other: Expression ) -> BooleanExpression
354
369
355
- func lte( _ other: Sendable ) -> BooleanExpression
370
+ /// Creates a `BooleanExpr` that returns `true` if this expression is less
371
+ /// than the given value.
372
+ ///
373
+ /// - Parameter other: The value to compare against.
374
+ /// - Returns: A `BooleanExpr` that can be used in `where` clauses.
375
+ func lessThan( _ other: Sendable ) -> BooleanExpression
356
376
357
- // MARK: - Equal (eq)
377
+ /// Creates a `BooleanExpr` that returns `true` if this expression is less
378
+ /// than or equal to the given expression.
379
+ ///
380
+ /// - Parameter other: The expression to compare against.
381
+ /// - Returns: A `BooleanExpr` that can be used in `where` clauses.
382
+ func lessThanOrEqualTo( _ other: Expression ) -> BooleanExpression
358
383
359
- func eq( _ other: Expression ) -> BooleanExpression
384
+ /// Creates a `BooleanExpr` that returns `true` if this expression is less
385
+ /// than or equal to the given value.
386
+ ///
387
+ /// - Parameter other: The value to compare against.
388
+ /// - Returns: A `BooleanExpr` that can be used in `where` clauses.
389
+ func lessThanOrEqualTo( _ other: Sendable ) -> BooleanExpression
360
390
361
- func eq( _ other: Sendable ) -> BooleanExpression
391
+ /// Creates a `BooleanExpr` that returns `true` if this expression is equal
392
+ /// to the given expression.
393
+ ///
394
+ /// - Parameter other: The expression to compare against.
395
+ /// - Returns: A `BooleanExpr` that can be used in `where` clauses.
396
+ func equal( _ other: Expression ) -> BooleanExpression
362
397
363
- func neq( _ other: Expression ) -> BooleanExpression
398
+ /// Creates a `BooleanExpr` that returns `true` if this expression is equal
399
+ /// to the given value.
400
+ ///
401
+ /// - Parameter other: The value to compare against.
402
+ /// - Returns: A `BooleanExpr` that can be used in `where` clauses.
403
+ func equal( _ other: Sendable ) -> BooleanExpression
364
404
365
- func neq( _ other: Sendable ) -> BooleanExpression
405
+ /// Creates a `BooleanExpr` that returns `true` if this expression is not
406
+ /// equal to the given expression.
407
+ ///
408
+ /// - Parameter other: The expression to compare against.
409
+ /// - Returns: A `BooleanExpr` that can be used in `where` clauses.
410
+ func notEqual( _ other: Expression ) -> BooleanExpression
366
411
367
- // MARK: Equality with Sendable
412
+ /// Creates a `BooleanExpr` that returns `true` if this expression is not
413
+ /// equal to the given value.
414
+ ///
415
+ /// - Parameter other: The value to compare against.
416
+ /// - Returns: A `BooleanExpr` that can be used in `where` clauses.
417
+ func notEqual( _ other: Sendable ) -> BooleanExpression
368
418
369
419
/// Creates an expression that checks if this expression is equal to any of the provided
370
420
/// expression values.
@@ -972,11 +1022,11 @@ public protocol Expression: Sendable {
972
1022
///
973
1023
/// ```swift
974
1024
/// // Calculate the average age of users
975
- /// Field("age").avg ().alias("averageAge")
1025
+ /// Field("age").average ().alias("averageAge")
976
1026
/// ```
977
1027
///
978
- /// - Returns: A new `AggregateFunction` representing the "avg " aggregation.
979
- func avg ( ) -> AggregateFunction
1028
+ /// - Returns: A new `AggregateFunction` representing the "average " aggregation.
1029
+ func average ( ) -> AggregateFunction
980
1030
981
1031
/// Creates an aggregation that finds the minimum value of this expression across multiple stage
982
1032
/// inputs.
0 commit comments