AssociativeBinaryOperator
public struct AssociativeBinaryOperator : Hashable
AssociativeBinaryOperator
is an associative binary operator,
such as +
, *
, AND
, etc.
Use it with the joined(operator:)
method. For example:
// SELECT score + bonus + 1000 FROM player
let values = [
scoreColumn,
bonusColumn,
1000.databaseValue]
Player.select(values.joined(operator: .add))
-
The
+
binary operatorFor example:
// score + bonus [Column("score"), Column("bonus")].joined(operator: .add)
Declaration
Swift
public static let add: SQLExpression.AssociativeBinaryOperator
-
The
*
binary operatorFor example:
// score * factor [Column("score"), Column("factor")].joined(operator: .multiply)
Declaration
Swift
public static let multiply: SQLExpression.AssociativeBinaryOperator
-
The
AND
binary operatorFor example:
// isBlue AND isTall [Column("isBlue"), Column("isTall")].joined(operator: .and)
Declaration
Swift
public static let and: SQLExpression.AssociativeBinaryOperator
-
The
OR
binary operatorFor example:
// isBlue OR isTall [Column("isBlue"), Column("isTall")].joined(operator: .or)
Declaration
Swift
public static let or: SQLExpression.AssociativeBinaryOperator
-
The
||
string concatenation operatorFor example:
// firstName || ' ' || lastName [Column("firstName"), " ", Column("lastName")].joined(operator: .concat)
Declaration
Swift
public static let concat: SQLExpression.AssociativeBinaryOperator