Struct debil::QueryBuilder
source · [−]pub struct QueryBuilder<V> { /* private fields */ }
Implementations
sourceimpl<V> QueryBuilder<V>
impl<V> QueryBuilder<V>
pub fn new() -> QueryBuilder<V>
pub fn table(self, table_name: impl Into<String>) -> QueryBuilder<V>
pub fn selects(self, selects: Vec<impl Into<String>>) -> QueryBuilder<V>
pub fn append_selects(self, selects: Vec<impl Into<String>>) -> QueryBuilder<V>
pub fn wheres<S: Into<String>>(
self,
(cond, params): (Vec<S>, Vec<(String, V)>)
) -> QueryBuilder<V>
pub fn filter(self, cond: impl Into<String>) -> QueryBuilder<V>
pub fn limit(self, n: i32) -> QueryBuilder<V>
pub fn order_by(
self,
column_name: impl Into<String>,
ordering: Ordering
) -> Self
pub fn inner_join(
self,
target_table: impl Into<String>,
on_fields: (impl Into<String>, impl Into<String>)
) -> QueryBuilder<V>
pub fn left_join(
self,
target_table: impl Into<String>,
on_fields: (impl Into<String>, impl Into<String>)
) -> QueryBuilder<V>
pub fn right_join(
self,
target_table: impl Into<String>,
on_fields: (impl Into<String>, impl Into<String>)
) -> QueryBuilder<V>
pub fn group_by<S: Into<String>>(self, fields: Vec<S>) -> QueryBuilder<V>
pub fn build(self) -> (String, Params<V>)
pub async fn load<R: QueryExecutor<T, E, ValueType = V>, T, E>(
self,
executor: &R
) -> Result<Vec<T>, E>
pub async fn first<R: QueryExecutor<T, E, ValueType = V>, T, E>(
self,
executor: &R
) -> Result<T, E>
pub async fn save<R: QueryExecutor<T, E, ValueType = V>, T, E>(
self,
executor: &R,
data: T
) -> Result<(), E>
pub async fn save_all<R: QueryExecutor<T, E, ValueType = V>, T, E>(
self,
executor: &R,
data: Vec<T>
) -> Result<(), E>
Trait Implementations
sourceimpl<V: Clone> Clone for QueryBuilder<V>
impl<V: Clone> Clone for QueryBuilder<V>
sourcefn clone(&self) -> QueryBuilder<V>
fn clone(&self) -> QueryBuilder<V>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<V> RefUnwindSafe for QueryBuilder<V> where
V: RefUnwindSafe,
impl<V> Send for QueryBuilder<V> where
V: Send,
impl<V> Sync for QueryBuilder<V> where
V: Sync,
impl<V> Unpin for QueryBuilder<V> where
V: Unpin,
impl<V> UnwindSafe for QueryBuilder<V> where
V: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more