pub struct Query<'q, E: Executor> { /* private fields */ }Implementations§
Source§impl<'q, E> Query<'q, E>where
E: Executor,
impl<'q, E> Query<'q, E>where
E: Executor,
pub fn new(table: &str, exc: &'q E) -> Self
pub fn table(&mut self, name: &'q str) -> &mut Self
pub fn select(&mut self, columns: Vec<&str>) -> &mut Self
pub fn where<T: 'q + Encode<'q, E::T> + Type<E::T>>( &mut self, column: &str, operator: &str, val: T, ) -> &mut Self
pub fn and_where<T: 'q + Encode<'q, E::T> + Type<E::T>>( &mut self, column: &str, operator: &str, val: T, ) -> &mut Self
pub fn or_where<T: 'q + Encode<'q, E::T> + Type<E::T>>( &mut self, column: &str, operator: &str, val: T, ) -> &mut Self
pub fn order_by(&mut self, column: &str, order: Order) -> &mut Self
pub fn join( &mut self, table: &str, column: &str, operator: &str, column_table: &str, ) -> &mut Self
pub fn join_inner( &mut self, table: &str, column: &str, operator: &str, column_table: &str, ) -> &mut Self
pub fn join_right( &mut self, table: &str, column: &str, operator: &str, column_table: &str, ) -> &mut Self
pub fn join_full_outer( &mut self, table: &str, column: &str, operator: &str, column_table: &str, ) -> &mut Self
pub fn join_cross( &mut self, table: &str, column: &str, operator: &str, column_table: &str, ) -> &mut Self
pub fn limit(&mut self, limit: u64) -> &mut Self
pub fn bind<T: 'q + Encode<'q, E::T> + Type<E::T>>( &'q mut self, value: T, ) -> &'q mut Self
pub async fn query<O, T: 'q + Encode<'q, E::T> + Type<E::T>>( &'q mut self, sql: &str, args: Vec<T>, ) -> Result<Vec<O>>
pub async fn query_all<O, T: 'q + Encode<'q, E::T> + Type<E::T>>( &'q mut self, sql: &str, args: Vec<T>, ) -> Result<Vec<O>>
pub async fn query_one<O, T: 'q + Encode<'q, E::T> + Type<E::T>>( &'q mut self, sql: &str, args: Vec<T>, ) -> Result<O>
pub fn insert_as<O>(&'q mut self, columns: Vec<&str>) -> InsertAs<'q, E, O>
pub fn insert(&'q mut self, columns: Vec<&str>) -> Insert<'q, E>
pub fn update<T: 'q + Encode<'q, E::T> + Type<E::T>>( &'q mut self, columns: Vec<&str>, ) -> Update<'q, E, T>
pub async fn delete(&'q mut self) -> Result<()>
pub async fn first<O>(&'q mut self) -> Result<O>
pub async fn all<O>(&'q mut self) -> Result<Vec<O>>
pub async fn count(&'q mut self) -> Result<u64>
pub async fn exists(&'q mut self) -> Result<bool>
pub async fn paginate<O>( &'q mut self, limit: u64, page: u64, ) -> Result<Pagination<O>>
pub fn to_sql(&'q mut self) -> Result<String>
Auto Trait Implementations§
impl<'q, E> Freeze for Query<'q, E>
impl<'q, E> RefUnwindSafe for Query<'q, E>
impl<'q, E> Send for Query<'q, E>
impl<'q, E> Sync for Query<'q, E>
impl<'q, E> Unpin for Query<'q, E>
impl<'q, E> UnsafeUnpin for Query<'q, E>
impl<'q, E> UnwindSafe for Query<'q, E>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more