pub struct Set {
pub exprs: Vec<Expr>,
}Expand description
The assignment list of an UPDATE, or of DO UPDATE / ON DUPLICATE KEY UPDATE.
The SET keyword is not written here, and this is the one clause in the
module that does not write its own. The reason is grammatical: MySQL’s
INSERT … ON DUPLICATE KEY UPDATE col = val takes exactly this list with no
SET in front of it, while UPDATE t SET … and PostgreSQL’s
DO UPDATE SET … both need one. Whatever contains the list therefore supplies
the keyword.
An assignment is a whole expression rather than a column/value pair, because
PostgreSQL’s multi-column form (a, b) = (SELECT x, y FROM …) is one
assignment with a row on each side, and a pair could not hold it.
Fields§
§exprs: Vec<Expr>The assignments, in order.
Implementations§
Source§impl Set
impl Set
Sourcepub fn append_set(&mut self, expr: impl IntoExpr)
pub fn append_set(&mut self, expr: impl IntoExpr)
Append one assignment.
Sourcepub fn append_sets(&mut self, exprs: impl IntoExprList)
pub fn append_sets(&mut self, exprs: impl IntoExprList)
Append several assignments.
Trait Implementations§
Source§impl Expression for Set
impl Expression for Set
Auto Trait Implementations§
impl !RefUnwindSafe for Set
impl !UnwindSafe for Set
impl Freeze for Set
impl Send for Set
impl Sync for Set
impl Unpin for Set
impl UnsafeUnpin for Set
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more