Enum Assignment
pub enum Assignment {
Set(Expr),
Insert(Expr),
Remove(Expr),
Append(Expr),
Pop,
RemoveAt(Expr),
Batch(Vec<Assignment>),
}Expand description
A field assignment within an Update statement.
Each variant carries the expression providing the value for the operation.
Multiple operations on the same field are represented via Batch.
§Examples
use toasty_core::stmt::{Assignment, Expr};
let assignment = Assignment::Set(Expr::null());
assert!(assignment.is_set());Variants§
Set(Expr)
Set a field, replacing the current value.
Insert(Expr)
Insert one or more values into a set field.
Remove(Expr)
Remove one or more values from a set field.
Append(Expr)
Append every element of a list expression to the end of an ordered
collection field (e.g. Vec<scalar>). The expression must evaluate
to a list whose element type matches the target column.
Pop
Drop the last element of an ordered collection field. Drives
stmt::pop on Vec<scalar> fields.
No-op on an empty collection.
RemoveAt(Expr)
Drop the element at the given index from an ordered collection field.
The expression must evaluate to a usize-shaped value. Out-of-bounds
indices are a no-op rather than an error — per-row failure semantics
on a bulk update are rarely useful.
Batch(Vec<Assignment>)
Multiple assignments on the same field.
Implementations§
§impl Assignment
impl Assignment
Trait Implementations§
§impl Clone for Assignment
impl Clone for Assignment
§fn clone(&self) -> Assignment
fn clone(&self) -> Assignment
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more