Struct sqlb::SelectSqlBuilder
source · pub struct SelectSqlBuilder<'a> { /* private fields */ }
Implementations§
source§impl<'a> SelectSqlBuilder<'a>
impl<'a> SelectSqlBuilder<'a>
pub fn and_where_eq<T: 'a + SqlxBindable + Send + Sync>( self, name: &str, val: T ) -> Self
pub fn and_where<T: 'a + SqlxBindable + Send + Sync>( self, name: &str, op: &'static str, val: T ) -> Self
pub fn table(self, table: &str) -> Self
pub fn columns(self, names: &[&str]) -> Self
pub fn order_bys(self, odrs: &[&str]) -> Self
pub fn order_by(self, odr: &str) -> Self
pub fn limit(self, limit: i64) -> Self
pub fn offset(self, offset: i64) -> Self
pub async fn exec<'q, DB>(&'a self, db_pool: DB) -> Result<u64, Error>where DB: Executor<'q, Database = Postgres>,
pub async fn fetch_one<'e, DB, D>(&'a self, db_pool: DB) -> Result<D, Error>where DB: Executor<'e, Database = Postgres>, D: for<'r> FromRow<'r, PgRow> + Unpin + Send,
pub async fn fetch_optional<'e, DB, D>( &'a self, db_pool: DB ) -> Result<Option<D>, Error>where DB: Executor<'e, Database = Postgres>, D: for<'r> FromRow<'r, PgRow> + Unpin + Send,
pub async fn fetch_all<'e, DB, D>( &'a self, db_pool: DB ) -> Result<Vec<D>, Error>where DB: Executor<'e, Database = Postgres>, D: for<'r> FromRow<'r, PgRow> + Unpin + Send,
Trait Implementations§
source§impl<'a> SqlBuilder<'a> for SelectSqlBuilder<'a>
impl<'a> SqlBuilder<'a> for SelectSqlBuilder<'a>
fn sql(&self) -> String
fn vals( &'a self ) -> Box<dyn Iterator<Item = &Box<dyn SqlxBindable + Send + Sync + 'a>> + Send + 'a>
fn exec<'q, 'async_trait, DB>( &'a self, db_pool: DB ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where DB: Executor<'q, Database = Postgres> + 'async_trait, Self: 'async_trait, 'q: 'async_trait, 'a: 'async_trait,
fn fetch_one<'e, 'async_trait, DB, D>( &'a self, db_pool: DB ) -> Pin<Box<dyn Future<Output = Result<D, Error>> + Send + 'async_trait>>where DB: Executor<'e, Database = Postgres> + 'async_trait, D: for<'r> FromRow<'r, PgRow> + Unpin + Send + 'async_trait, Self: 'async_trait, 'e: 'async_trait, 'a: 'async_trait,
fn fetch_optional<'e, 'async_trait, DB, D>( &'a self, db_pool: DB ) -> Pin<Box<dyn Future<Output = Result<Option<D>, Error>> + Send + 'async_trait>>where DB: Executor<'e, Database = Postgres> + 'async_trait, D: for<'r> FromRow<'r, PgRow> + Unpin + Send + 'async_trait, Self: 'async_trait, 'e: 'async_trait, 'a: 'async_trait,
fn fetch_all<'e, 'async_trait, DB, D>( &'a self, db_pool: DB ) -> Pin<Box<dyn Future<Output = Result<Vec<D>, Error>> + Send + 'async_trait>>where DB: Executor<'e, Database = Postgres> + 'async_trait, D: for<'r> FromRow<'r, PgRow> + Unpin + Send + 'async_trait, Self: 'async_trait, 'e: 'async_trait, 'a: 'async_trait,
source§impl<'a> Whereable<'a> for SelectSqlBuilder<'a>
impl<'a> Whereable<'a> for SelectSqlBuilder<'a>
fn and_where_eq<V: 'a + SqlxBindable + Send + Sync>( self, name: &str, val: V ) -> Self
fn and_where<V: 'a + SqlxBindable + Send + Sync>( self, name: &str, op: &'static str, val: V ) -> Self
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for SelectSqlBuilder<'a>
impl<'a> Send for SelectSqlBuilder<'a>
impl<'a> Sync for SelectSqlBuilder<'a>
impl<'a> Unpin for SelectSqlBuilder<'a>
impl<'a> !UnwindSafe for SelectSqlBuilder<'a>
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