Struct sqlb::SelectSqlBuilder

source ·
pub struct SelectSqlBuilder<'a> { /* private fields */ }

Implementations§

source§

impl<'a> SelectSqlBuilder<'a>

source

pub fn and_where_eq<T: 'a + SqlxBindable + Send + Sync>( self, name: &str, val: T ) -> Self

source

pub fn and_where<T: 'a + SqlxBindable + Send + Sync>( self, name: &str, op: &'static str, val: T ) -> Self

source

pub fn table(self, table: &str) -> Self

source

pub fn columns(self, names: &[&str]) -> Self

source

pub fn order_bys(self, odrs: &[&str]) -> Self

source

pub fn order_by(self, odr: &str) -> Self

source

pub fn limit(self, limit: i64) -> Self

source

pub fn offset(self, offset: i64) -> Self

source

pub async fn exec<'q, DB>(&'a self, db_pool: DB) -> Result<u64, Error>where DB: Executor<'q, Database = Postgres>,

source

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,

source

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,

source

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>

source§

fn sql(&self) -> String

source§

fn vals( &'a self ) -> Box<dyn Iterator<Item = &Box<dyn SqlxBindable + Send + Sync + 'a>> + Send + 'a>

source§

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,

source§

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,

source§

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,

source§

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>

source§

fn and_where_eq<V: 'a + SqlxBindable + Send + Sync>( self, name: &str, val: V ) -> Self

source§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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<T> for T

§

type Output = T

Should always be Self
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

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

§

fn vzip(self) -> V