Struct grafbase_sql_ast::ast::SingleRowInsert
source · 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>(self, key: K, val: V) -> SingleRowInsert<'a>where
K: Into<Column<'a>>,
V: Into<Expression<'a>>,
pub fn value<K, V>(self, key: K, val: V) -> SingleRowInsert<'a>where K: Into<Column<'a>>, V: Into<Expression<'a>>,
Adds a new value to the INSERT
statement
let query = Insert::single_into("users").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);
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>
source§fn eq(&self, other: &SingleRowInsert<'a>) -> bool
fn eq(&self, other: &SingleRowInsert<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'a> StructuralPartialEq for SingleRowInsert<'a>
Auto Trait Implementations§
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