pub struct QueryBuilder<M>where
M: Model,{ /* private fields */ }Implementations§
Source§impl<M> QueryBuilder<M>
impl<M> QueryBuilder<M>
pub fn new() -> QueryBuilder<M>
Sourcepub fn where_eq<T>(self, column: Column<M, T>, value: T) -> QueryBuilder<M>
pub fn where_eq<T>(self, column: Column<M, T>, value: T) -> QueryBuilder<M>
Type-safe equality: column type must match value type.
pub fn where_ne<T>(self, column: Column<M, T>, value: T) -> QueryBuilder<M>
pub fn where_gt<T>(self, column: Column<M, T>, value: T) -> QueryBuilder<M>
pub fn where_lt<T>(self, column: Column<M, T>, value: T) -> QueryBuilder<M>
pub fn where_in<T, I>(self, column: Column<M, T>, values: I) -> QueryBuilder<M>
pub fn where_raw(self, raw: SimpleExpr) -> QueryBuilder<M>
pub fn order_by<T>( self, column: Column<M, T>, ascending: bool, ) -> QueryBuilder<M>
pub fn order_by_asc<T>(self, column: Column<M, T>) -> QueryBuilder<M>
pub fn order_by_desc<T>(self, column: Column<M, T>) -> QueryBuilder<M>
pub fn limit(self, n: u64) -> QueryBuilder<M>
pub fn offset(self, n: u64) -> QueryBuilder<M>
pub async fn get(self, pool: &Pool<Postgres>) -> Result<Vec<M>, Error>
pub async fn first(self, pool: &Pool<Postgres>) -> Result<Option<M>, Error>
pub async fn count(self, pool: &Pool<Postgres>) -> Result<i64, Error>
Trait Implementations§
Source§impl<M> Default for QueryBuilder<M>where
M: Model,
impl<M> Default for QueryBuilder<M>where
M: Model,
Source§fn default() -> QueryBuilder<M>
fn default() -> QueryBuilder<M>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<M> Freeze for QueryBuilder<M>
impl<M> !RefUnwindSafe for QueryBuilder<M>
impl<M> Send for QueryBuilder<M>
impl<M> Sync for QueryBuilder<M>
impl<M> Unpin for QueryBuilder<M>
impl<M> UnsafeUnpin for QueryBuilder<M>
impl<M> !UnwindSafe for QueryBuilder<M>
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