UpdateOperation

This is the builder struct that's used for update operations.

Don't construct this struct manually, use the db.update or tx.update method to create this struct.

Methods you can call on this builder to manipulate the result: - condition to limit which rows to update. (can only be called once) - set!("sourceColumnName")(value) to update a single column to the given value - set(patchValue), where patchValue is a patch for this UpdateOperation, to set multiple fields at once.

Finishing methods you can call on this builder: - await to send the prepared update operation

Postblit

this(this)
this(this)
Undocumented in source.

Members

Aliases

ConditionBuilderCallback
alias ConditionBuilderCallback = Condition delegate(ConditionBuilder!T)

Argument to condition. Callback that takes in a ConditionBuilder!T and returns a Condition that can easily be created using that builder.

Functions

await
ulong await()

Starts the update procedure and waits for the result. Throws in case of an error. Returns the number of rows affected.

condition
UpdateOperation!(T, true) condition(ConditionBuilderCallback callback)

Limits the update to only rows matching this condition. Maps to the WHERE clause in an SQL statement.

Templates

set
template set(FieldOrPatch...)

Method to set one field or multiple via a patch. Update will be performed when await is called.

Meta