Skip to main content

Clause

Struct Clause 

Source
pub struct Clause<'q, T> { /* private fields */ }

Implementations§

Source§

impl<'q, T> Clause<'q, T>

Source

pub fn build(self) -> (String, Vec<&'q (dyn ToSql + Sync)>)

Build and compile query into SQL syntax with numbered parameters

Source

pub fn this(self) -> Self

Source

pub fn into<C>(self) -> Clause<'q, C>

Source§

impl<'q> Clause<'q, Condition>

Source

pub fn cast_raw(self, sql_type: &str) -> Clause<'q, Condition>

Source

pub fn and_col(self, column: &str) -> Clause<'q, Column>

Source

pub fn or_col(self, column: &str) -> Clause<'q, Column>

Source

pub fn and_cond(self, cond: Clause<'q, Condition>) -> Clause<'q, Condition>

Source

pub fn or_cond(self, cond: Clause<'q, Condition>) -> Clause<'q, Condition>

Source§

impl<'q> Clause<'q, Delete>

Source

pub fn where_col( self, column: &str, value: Clause<'q, Condition>, ) -> Clause<'q, DeleteWhere>

Source

pub fn where_cond(self, cond: Clause<'q, Condition>) -> Clause<'q, DeleteWhere>

Source§

impl<'q> Clause<'q, Insert>

Source

pub fn on_conflict_do_nothing(self) -> Clause<'q, ()>

Source

pub fn on_conflict(self, cols: Clause<'q, Column>) -> OnConflictHandle<'q>

Source§

impl<'q> Clause<'q, Where>

Source

pub fn limit(self, limit: &'q i64) -> Clause<'q, Paging>

Source

pub fn offset(self, offset: &'q i64) -> Clause<'q, Paging>

Source§

impl<'q> Clause<'q, Paging>

Source

pub fn limit(self, limit: &'q i64) -> Clause<'q, ()>

Source

pub fn offset(self, offset: &'q i64) -> Clause<'q, ()>

Source§

impl<'q> Clause<'q, Order>

Source

pub fn limit(self, limit: &'q i64) -> Clause<'q, Paging>

Source

pub fn offset(self, offset: &'q i64) -> Clause<'q, Paging>

Source§

impl<'q> Clause<'q, Select>

Source

pub fn select<T>(self, clause: Clause<'q, T>) -> Clause<'q, Select>

Source

pub fn from(self, table: &str) -> Clause<'q, From>

Source§

impl<'q> Clause<'q, From>

Source

pub fn join(self, table: &str) -> Clause<'q, Join>

Source

pub fn left_join(self, table: &str) -> Clause<'q, Join>

Source

pub fn left_outer_join(self, table: &str) -> Clause<'q, Join>

Source

pub fn right_join(self, table: &str) -> Clause<'q, Join>

Source

pub fn right_outer_join(self, table: &str) -> Clause<'q, Join>

Source

pub fn where_col( self, name: &str, condition: Clause<'q, Condition>, ) -> Clause<'q, Where>

Source

pub fn where_cond(self, condition: Clause<'q, Condition>) -> Clause<'q, Where>

Source

pub fn limit(self, limit: &'q i64) -> Clause<'q, ()>

Source

pub fn offset(self, offset: &'q i64) -> Clause<'q, ()>

Source§

impl<'q> Clause<'q, Join>

Source

pub fn using(self, cols: Clause<'_, Column>) -> Clause<'q, From>

Source

pub fn using_col(self, col_name: &str) -> Clause<'q, From>

Source

pub fn using_cols(self, col_names: &[&str]) -> Clause<'q, From>

Source

pub fn on(self, col1: &str, col2: &str) -> Clause<'q, From>

Source

pub fn on_wrap(self, condition: Clause<'q, Condition>) -> Clause<'q, From>

Source§

impl<'q> Clause<'q, Where>

Source

pub fn and( self, name: &str, condition: Clause<'q, Condition>, ) -> Clause<'q, Where>

Source

pub fn or( self, name: &str, condition: Clause<'q, Condition>, ) -> Clause<'q, Where>

Source

pub fn and_wrap(self, clause: Clause<'q, Where>) -> Clause<'q, Where>

Source

pub fn or_wrap(self, clause: Clause<'q, Where>) -> Clause<'q, Where>

Source

pub fn order_by_cols(self, columns: &[&str]) -> Clause<'q, Order>

Source§

impl<'q> Clause<'q, Update>

Source

pub fn set( self, map: &[(&str, &'q (dyn ToSql + Sync + 'q))], ) -> Clause<'q, UpdateSet>

Source§

impl<'q> Clause<'q, UpdateSet>

Source

pub fn where_col( self, name: &str, condition: Clause<'q, Condition>, ) -> Clause<'q, UpdateWhere>

Source

pub fn where_cond( self, condition: Clause<'q, Condition>, ) -> Clause<'q, UpdateWhere>

Source§

impl<'q> Clause<'q, UpdateWhere>

Source

pub fn and_cond( self, condition: Clause<'q, Condition>, ) -> Clause<'q, UpdateWhere>

Source

pub fn or_cond( self, condition: Clause<'q, Condition>, ) -> Clause<'q, UpdateWhere>

Source

pub fn and_wrap( self, condition: Clause<'q, Condition>, ) -> Clause<'q, UpdateWhere>

Source

pub fn or_wrap( self, condition: Clause<'q, Condition>, ) -> Clause<'q, UpdateWhere>

Source§

impl<'q> Clause<'q, Column>

Source

pub fn eq<T: ToSql + Sync + 'q>(self, value: &'q T) -> Clause<'q, Condition>

Source

pub fn neq<T: ToSql + Sync + 'q>(self, value: &'q T) -> Clause<'q, Condition>

Source

pub fn lt<T: ToSql + Sync + 'q>(self, value: &'q T) -> Clause<'q, Condition>

Source

pub fn gt<T: ToSql + Sync + 'q>(self, value: &'q T) -> Clause<'q, Condition>

Source

pub fn lte<T: ToSql + Sync + 'q>(self, value: &'q T) -> Clause<'q, Condition>

Source

pub fn gte<T: ToSql + Sync + 'q>(self, value: &'q T) -> Clause<'q, Condition>

Source

pub fn like<T: ToSql + Sync + 'q>(self, value: &'q T) -> Clause<'q, Condition>

Source

pub fn ilike<T: ToSql + Sync + 'q>(self, value: &'q T) -> Clause<'q, Condition>

Source

pub fn between<T: ToSql + Sync + 'q>( self, low: &'q T, high: &'q T, ) -> Clause<'q, Condition>

Source

pub fn op<T: ToSql + Sync + 'q>( self, op: &str, value: &'q T, ) -> Clause<'q, Condition>

Source

pub fn eq_true(self) -> Clause<'q, Condition>

Source

pub fn not(self) -> Clause<'q, Condition>

Source

pub fn null(self) -> Clause<'q, Condition>

Source

pub fn not_null(self) -> Clause<'q, Condition>

Trait Implementations§

Source§

impl<'q, T: Clone> Clone for Clause<'q, T>

Source§

fn clone(&self) -> Clause<'q, T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'q, T: Debug> Debug for Clause<'q, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'q, T> Freeze for Clause<'q, T>

§

impl<'q, T> !RefUnwindSafe for Clause<'q, T>

§

impl<'q, T> Send for Clause<'q, T>
where T: Send,

§

impl<'q, T> Sync for Clause<'q, T>
where T: Sync,

§

impl<'q, T> Unpin for Clause<'q, T>
where T: Unpin,

§

impl<'q, T> UnsafeUnpin for Clause<'q, T>

§

impl<'q, T> !UnwindSafe for Clause<'q, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V