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]
pub fn returning<E>(self, returns: E) -> InsertQuery<E, Self> where
E: Expression + SelectableExpression<T>,
InsertQuery<E, Self>: Query,
[src]
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: Debug, U: Debug, Op: Debug> Debug for InsertStatement<T, U, Op>
[src]
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]
fn clone(&self) -> InsertStatement<T, U, Op>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
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]
DB: Backend,
T: Table,
T::FromClause: QueryFragment<DB>,
U: Insertable<T, DB> + Copy,
Op: QueryFragment<DB>,
fn to_sql(&self, out: &mut DB::QueryBuilder) -> BuildQueryResult
[src]
fn collect_binds(&self, out: &mut DB::BindCollector) -> QueryResult<()>
[src]
fn is_safe_to_cache_prepared(&self) -> bool
[src]
impl<T, U, Op> QueryId for InsertStatement<T, U, Op>
[src]
impl<T, U, Op> AsQuery for InsertStatement<T, U, Op> where
T: Table,
InsertQuery<T::AllColumns, InsertStatement<T, U, Op>>: Query,
[src]
T: Table,
InsertQuery<T::AllColumns, InsertStatement<T, U, Op>>: Query,