pub struct MultiRowInsert<'a> { /* private fields */ }
Expand description
A builder for an INSERT
statement for multiple rows.
Implementations§
Source§impl<'a> MultiRowInsert<'a>
impl<'a> MultiRowInsert<'a>
Sourcepub fn values<V>(&mut self, values: V)
pub fn values<V>(&mut self, values: V)
Adds multiple new rows to be inserted.
let mut query = Insert::multi_into("users", vec!["foo"]);
query.values(vec![1]);
query.values(vec![2]);
let (sql, params) = renderer::Postgres::build(query);
assert_eq!(r#"INSERT INTO "users" ("foo") VALUES ($1), ($2)"#, sql);
assert_eq!(
vec![
Value::from(1),
Value::from(2),
], params);
Sourcepub fn extend(&mut self, other: SingleRowInsert<'a>) -> Result<()>
pub fn extend(&mut self, other: SingleRowInsert<'a>) -> Result<()>
Extend the insert statement with a single row insert.
Both inserts must be to the same table and must include the same columns.
Trait Implementations§
Source§impl<'a> Clone for MultiRowInsert<'a>
impl<'a> Clone for MultiRowInsert<'a>
Source§fn clone(&self) -> MultiRowInsert<'a>
fn clone(&self) -> MultiRowInsert<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for MultiRowInsert<'a>
impl<'a> Debug for MultiRowInsert<'a>
Source§impl<'a> From<MultiRowInsert<'a>> for Insert<'a>
impl<'a> From<MultiRowInsert<'a>> for Insert<'a>
Source§fn from(insert: MultiRowInsert<'a>) -> Self
fn from(insert: MultiRowInsert<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<MultiRowInsert<'a>> for Query<'a>
impl<'a> From<MultiRowInsert<'a>> for Query<'a>
Source§fn from(insert: MultiRowInsert<'a>) -> Query<'a>
fn from(insert: MultiRowInsert<'a>) -> Query<'a>
Converts to this type from the input type.
Source§impl<'a> PartialEq for MultiRowInsert<'a>
impl<'a> PartialEq for MultiRowInsert<'a>
impl<'a> StructuralPartialEq for MultiRowInsert<'a>
Auto Trait Implementations§
impl<'a> Freeze for MultiRowInsert<'a>
impl<'a> RefUnwindSafe for MultiRowInsert<'a>
impl<'a> Send for MultiRowInsert<'a>
impl<'a> Sync for MultiRowInsert<'a>
impl<'a> Unpin for MultiRowInsert<'a>
impl<'a> UnwindSafe for MultiRowInsert<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more