pub struct SqlBuilder { /* private fields */ }Expand description
A SQL builder for constructing queries.
Implementations§
Source§impl SqlBuilder
impl SqlBuilder
Sourcepub fn new(db_type: DatabaseType) -> Self
pub fn new(db_type: DatabaseType) -> Self
Create a new SQL builder.
Sourcepub fn push_param(&mut self, value: impl Into<FilterValue>) -> &mut Self
pub fn push_param(&mut self, value: impl Into<FilterValue>) -> &mut Self
Push a SQL string with a parameter.
Sourcepub fn push_identifier(&mut self, name: &str) -> &mut Self
pub fn push_identifier(&mut self, name: &str) -> &mut Self
Push an identifier (properly quoted if needed).
Sourcepub fn build(self) -> (String, Vec<FilterValue>)
pub fn build(self) -> (String, Vec<FilterValue>)
Build the final SQL string and parameters.
Sourcepub fn params(&self) -> &[FilterValue]
pub fn params(&self) -> &[FilterValue]
Get the current parameters.
Sourcepub fn next_param_index(&self) -> usize
pub fn next_param_index(&self) -> usize
Get the next parameter index.
Trait Implementations§
Source§impl Clone for SqlBuilder
impl Clone for SqlBuilder
Source§fn clone(&self) -> SqlBuilder
fn clone(&self) -> SqlBuilder
Returns a duplicate 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 Debug for SqlBuilder
impl Debug for SqlBuilder
Auto Trait Implementations§
impl Freeze for SqlBuilder
impl RefUnwindSafe for SqlBuilder
impl Send for SqlBuilder
impl Sync for SqlBuilder
impl Unpin for SqlBuilder
impl UnwindSafe for SqlBuilder
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