UpdateQueryBuilder
Builder for constructing UPDATE queries with type-safe value updates.Type Parameters
DB- The database schema typeUT- The table name being updatedTB- Union of table names available (for joins)O- The output type (UpdateResult or custom with returning)
Methods
set
UpdateResult. Use returning on supported databases to get the updated rows.
Examples:
Update a single row:
where
WhereInterface documentation for more examples.
whereRef
from
innerJoin
SelectQueryBuilder.innerJoin for examples.
leftJoin
innerJoin but adds a left join instead.
rightJoin
innerJoin but adds a right join instead.
fullJoin
innerJoin but adds a full join instead.
returning
returningAll
returning * or returning table.* clause to the query.
output
outputAll
output * clause (MS SQL Server).
top
update query to an update top query (MS SQL Server).
Example:
limit
SQLITE_ENABLE_UPDATE_DELETE_LIMIT).
Example:
orderBy
SQLITE_ENABLE_UPDATE_DELETE_LIMIT).
See OrderByInterface documentation for more examples.
$call
this as the only argument.
Example:
$if
func(this) if condition is true.
Especially handy with optional returning or returningAll calls.
Example:
$castTo
$narrowType
execute
executeTakeFirst
undefined.