[−][src]Struct quaint::ast::Insert
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]
T: Into<Table<'a>>,
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]
T: Into<Table<'a>>,
K: Into<Column<'a>>,
I: IntoIterator<Item = K>,
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]
K: Into<Column<'a>>,
I: IntoIterator<Item = K>,
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]
fn from(insert: MultiRowInsert<'a>) -> Self
[src]
impl<'a> From<SingleRowInsert<'a>> for Insert<'a>
[src]
fn from(insert: SingleRowInsert<'a>) -> Self
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,