DeleteQuery
A DELETE under construction. A WHERE is required; emptying a table is written with rawQuery.
val removed = db.deleteFrom("expired_mandates")
.where("expires_at < @cutoff")
.returning("id")
.fetchFields<Int>("cutoff" to cutoff)Properties
Functions
This query with terminals that return a DataResult instead of throwing, on the boundary dbResult applies - a fetch*Strict that found no row still throws.
Turns this query into a step of a TransactionPlan instead of running it. The parameters given at the step's terminal may hold TransactionValues pointing at earlier steps.
Returns an independent copy, so that variants can be built from a shared base.
Carries registered converters into a builder's copy(), alongside whatever clauses it copies.
Runs the statement and returns how many rows it affected.
As fetchField, but the query must return exactly one row rather than at most one.
Runs the query and returns its single row, throwing where the count was anything but one.
Runs the query and hands the first column of each row, as T, to block as forEachRow does.
Runs the query and hands each row, mapped onto T, to block as it arrives, as forEachRow does.
The driver query every terminal runs, carrying this query's own converters.
Marks the WITH clause RECURSIVE.
Registers a ParameterConverter for this query alone, on the terms of registerResultConverter.
Registers a ResultConverter for this query alone, consulted ahead of the session's. A later registration here wins over an earlier one.
Adds a RETURNING clause, which turns this into a query the fetch* family can read.
Sets the USING clause, for a delete that joins against other tables.
Sets the WHERE condition. Required.
Adds a common table expression. Call it more than once for more than one.