pub struct InsertBuilder { /* private fields */ }Expand description
Fluent builder for INSERT queries.
§Example
use oxisql_core::query::InsertBuilder;
let q = InsertBuilder::new()
.into_table("users")
.column("name", &"Alice")
.column("age", &30i64)
.build();
assert_eq!(q.sql, "INSERT INTO users (name, age) VALUES ($1, $2)");Implementations§
Source§impl InsertBuilder
impl InsertBuilder
Sourcepub fn into_table(self, table: &str) -> Self
pub fn into_table(self, table: &str) -> Self
Set the target table for the INSERT.
Sourcepub fn column(self, col: &str, val: &dyn ToSqlValue) -> Self
pub fn column(self, col: &str, val: &dyn ToSqlValue) -> Self
Add a column-value pair for the INSERT.
Sourcepub fn build(self) -> BuiltQuery
pub fn build(self) -> BuiltQuery
Build the query into a BuiltQuery.
Trait Implementations§
Source§impl Clone for InsertBuilder
impl Clone for InsertBuilder
Source§fn clone(&self) -> InsertBuilder
fn clone(&self) -> InsertBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InsertBuilder
impl Debug for InsertBuilder
Source§impl Default for InsertBuilder
impl Default for InsertBuilder
Source§fn default() -> InsertBuilder
fn default() -> InsertBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for InsertBuilder
impl RefUnwindSafe for InsertBuilder
impl Send for InsertBuilder
impl Sync for InsertBuilder
impl Unpin for InsertBuilder
impl UnsafeUnpin for InsertBuilder
impl UnwindSafe for InsertBuilder
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