Skip to content
Vapor Week is coming 14th September!

Instance Method

where(_:_:_:)

Adds a column to encodable 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", .equal, "Earth")

The encodable value supplied will be bound to the query as a parameter.

SELECT * FROM "planets" WHERE "name" = $0 ["Earth"]