Struct diesel::query_builder::insert_statement::InsertStatement [] [src]

pub struct InsertStatement<T, U, Op = Insert, Ret = NoReturningClause> { /* fields omitted */ }

Methods

impl<T, U, Op, Ret> InsertStatement<T, U, Op, Ret>
[src]

impl<T, U, Op> InsertStatement<T, U, Op, NoReturningClause>
[src]

Specify what expression is returned after execution of the insert. This method can only be called once.

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, Ret: Clone> Clone for InsertStatement<T, U, Op, Ret>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Copy, U: Copy, Op: Copy, Ret: Copy> Copy for InsertStatement<T, U, Op, Ret>
[src]

impl<T: Debug, U: Debug, Op: Debug, Ret: Debug> Debug for InsertStatement<T, U, Op, Ret>
[src]

Formats the value using the given formatter.

impl<T, U, Op, Ret, DB> QueryFragment<DB> for InsertStatement<T, U, Op, Ret> where DB: Backend,
        T: Table,
        T::FromClause: QueryFragment<DB>,
        U: Insertable<T, DB> + Copy,
        Op: QueryFragment<DB>,
        Ret: QueryFragment<DB>
[src]

impl<T, U, Op, Ret> QueryId for InsertStatement<T, U, Op, Ret>
[src]

impl<T, U, Op> AsQuery for InsertStatement<T, U, Op, NoReturningClause> where T: Table,
        InsertStatement<T, U, Op, ReturningClause<T::AllColumns>>: Query
[src]

impl<T, U, Op, Ret> Query for InsertStatement<T, U, Op, ReturningClause<Ret>> where Ret: Expression + SelectableExpression<T> + NonAggregate
[src]