Skip to content

Instance Method

having(_:_:_:)

Adds a column to encodable array comparison to this builder’s HAVING clause by ANDing.
@discardableResult func having(_ lhs: SQLIdentifier, _ op: SQLBinaryOperator, _ rhs: [some Encodable & Sendable]) -> Self

Discussion

builder.having("name", .in, ["Earth", "Mars"])

The encodable values supplied will be bound to the query as parameters.

SELECT * FROM "planets" HAVING "name" IN ($0, $1) ["Earth", "Mars"]