Skip to main content

extend

Function extend 

Source
pub fn extend<T>(items: impl IntoExpr<List<T>>) -> Assignment<List<T>>
Expand description

Append every element of a list to an ordered collection field.

Takes a list-shaped expression (anything that converts to List<T> — Vec<T>, [T; N], &[T], …) and produces an assignment for List<T>. Elements are appended in order and the operation is atomic against the existing column value, same as push.

After .exec(), the instance’s field reflects the post-update value. stmt::extend(iter) of an empty iterator is a no-op.

§Examples

ⓘ
user.update()
    .tags(stmt::extend(["admin", "verified"]))
    .exec(&mut db)
    .await?;