Skip to content

Instance Method

where(_:_:_:)

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

Discussion

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

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

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