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

pub struct InsertStatement<T, U, Op> { /* fields omitted */ }

Methods

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

[src]

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

[src]

Formats the value using the given formatter.

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

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

[src]

[src]

[src]

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

[src]

[src]

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

[src]