Instance Method
select(_:)
Specify a
SELECT query to generate rows to insert.@discardableResult func select(_ closure: (SQLSubqueryBuilder) throws -> SQLSubqueryBuilder) rethrows -> Self
Parameters
closureA closure which builds a
SELECTsubquery using the provided builder.
Discussion
Example usage:
try await database.insert(into: "table")
.columns("id", "foo", "bar")
.select { $0
.column(SQLLiteral.default, as: "id")
.column("foo", table: "other")
.column("bar", table: "other")
.from("other")
.where(SQLColumn("created_at", table: "other"), .greaterThan, SQLBind(someDate))
}
.run()