[][src]Struct quaint::ast::Insert

pub struct Insert<'a> { /* fields omitted */ }

A builder for an INSERT statement.

Methods

impl<'a> Insert<'a>[src]

pub fn single_into<T>(table: T) -> SingleRowInsert<'a> where
    T: Into<Table<'a>>, 
[src]

Creates a new single row INSERT statement for the given table.

let query = Insert::single_into("users");
let (sql, _) = Sqlite::build(query);

assert_eq!("INSERT INTO `users` DEFAULT VALUES", sql);

pub fn multi_into<T, K, I>(table: T, columns: I) -> MultiRowInsert<'a> where
    T: Into<Table<'a>>,
    K: Into<Column<'a>>,
    I: IntoIterator<Item = K>, 
[src]

Creates a new multi row INSERT statement for the given table.

pub fn on_conflict(self, on_conflict: OnConflict) -> Self[src]

Sets the conflict resolution strategy.

pub fn returning<K, I>(self, columns: I) -> Self where
    K: Into<Column<'a>>,
    I: IntoIterator<Item = K>, 
[src]

Sets the returned columns.

let query = Insert::single_into("users");
let insert = Insert::from(query).returning(vec!["id"]);
let (sql, _) = Postgres::build(insert);

assert_eq!("INSERT INTO \"users\" DEFAULT VALUES RETURNING \"id\"", sql);

Trait Implementations

impl<'a> Clone for Insert<'a>[src]

impl<'a> Debug for Insert<'a>[src]

impl<'a> From<Insert<'a>> for Query<'a>[src]

impl<'a> From<MultiRowInsert<'a>> for Insert<'a>[src]

impl<'a> From<SingleRowInsert<'a>> for Insert<'a>[src]

impl<'a> PartialEq<Insert<'a>> for Insert<'a>[src]

impl<'a> StructuralPartialEq for Insert<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Insert<'a>

impl<'a> Send for Insert<'a>

impl<'a> Sync for Insert<'a>

impl<'a> Unpin for Insert<'a>

impl<'a> UnwindSafe for Insert<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,