Struct diesel::query_builder::insert_statement::InsertStatement
[−]
[src]
pub struct InsertStatement<T, U, Op> { // some fields omitted }
Methods
impl<T, U, Op> InsertStatement<T, U, Op>
[src]
fn returning<E>(self, returns: E) -> InsertQuery<E, Self> where E: Expression + SelectableExpression<T>, InsertQuery<E, Self>: Query
Specify what expression is returned after execution of the insert
.
Examples
Inserting a record:
let new_user = NewUser { name: "Timmy".to_string(), }; let inserted_name = diesel::insert(&new_user) .into(users) .returning(name) .get_result(&connection); assert_eq!(Ok("Timmy".to_string()), inserted_name);
Trait Implementations
impl<T: Clone, U: Clone, Op: Clone> Clone for InsertStatement<T, U, Op>
[src]
fn clone(&self) -> InsertStatement<T, U, Op>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more