pub struct SingleRowInsert<'a> { /* private fields */ }
Expand description
A builder for an INSERT
statement for a single row.
Implementations§
Source§impl<'a> SingleRowInsert<'a>
impl<'a> SingleRowInsert<'a>
Sourcepub fn value<K, V>(&mut self, key: K, val: V)
pub fn value<K, V>(&mut self, key: K, val: V)
Adds a new value to the INSERT
statement
let mut query = Insert::single_into("users");
query.value("foo", 10);
let (sql, params) = renderer::Postgres::build(query);
assert_eq!(r#"INSERT INTO "users" ("foo") VALUES ($1)"#, sql);
assert_eq!(vec![Value::from(10)], params);
Sourcepub fn merge(self, other: SingleRowInsert<'a>) -> Result<MultiRowInsert<'a>>
pub fn merge(self, other: SingleRowInsert<'a>) -> Result<MultiRowInsert<'a>>
Merge two single row inserts into a multi row insert.
Both inserts must be to the same table and must include the same columns.
Trait Implementations§
Source§impl<'a> Clone for SingleRowInsert<'a>
impl<'a> Clone for SingleRowInsert<'a>
Source§fn clone(&self) -> SingleRowInsert<'a>
fn clone(&self) -> SingleRowInsert<'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 SingleRowInsert<'a>
impl<'a> Debug for SingleRowInsert<'a>
Source§impl<'a> From<SingleRowInsert<'a>> for Insert<'a>
impl<'a> From<SingleRowInsert<'a>> for Insert<'a>
Source§fn from(insert: SingleRowInsert<'a>) -> Self
fn from(insert: SingleRowInsert<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<SingleRowInsert<'a>> for Query<'a>
impl<'a> From<SingleRowInsert<'a>> for Query<'a>
Source§fn from(insert: SingleRowInsert<'a>) -> Query<'a>
fn from(insert: SingleRowInsert<'a>) -> Query<'a>
Converts to this type from the input type.
Source§impl<'a> PartialEq for SingleRowInsert<'a>
impl<'a> PartialEq for SingleRowInsert<'a>
impl<'a> StructuralPartialEq for SingleRowInsert<'a>
Auto Trait Implementations§
impl<'a> Freeze for SingleRowInsert<'a>
impl<'a> RefUnwindSafe for SingleRowInsert<'a>
impl<'a> Send for SingleRowInsert<'a>
impl<'a> Sync for SingleRowInsert<'a>
impl<'a> Unpin for SingleRowInsert<'a>
impl<'a> UnwindSafe for SingleRowInsert<'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