pub struct SelectBuilder<'a> { /* private fields */ }
Implementations§
Source§impl<'a> SelectBuilder<'a>
impl<'a> SelectBuilder<'a>
pub fn new(table: TableSchema) -> Self
pub fn with_default_schema(self, schema: &'a str) -> Self
pub fn order_by(self, item: Order) -> Self
Trait Implementations§
Source§impl<'a> Debug for SelectBuilder<'a>
impl<'a> Debug for SelectBuilder<'a>
Source§impl<'a> QueryBuilder<'a> for SelectBuilder<'a>
impl<'a> QueryBuilder<'a> for SelectBuilder<'a>
type DB = Postgres
Source§async fn optional<'e, 'c: 'e, E, O>(
&self,
executor: E,
) -> Result<Option<O>, Error>
async fn optional<'e, 'c: 'e, E, O>( &self, executor: E, ) -> Result<Option<O>, Error>
获取一条记录,如果不存在返回 None
Source§async fn page<'e, 'c: 'e, E, O>(
&self,
executor: E,
page: &PageRequest,
) -> Result<PageResult<O>, Error>
async fn page<'e, 'c: 'e, E, O>( &self, executor: E, page: &PageRequest, ) -> Result<PageResult<O>, Error>
分页查询
Source§async fn one_scalar<'c, E, O>(
&self,
executor: E,
field: &Column,
) -> Result<O, Error>
async fn one_scalar<'c, E, O>( &self, executor: E, field: &Column, ) -> Result<O, Error>
获取一个标量
Source§async fn optional_scalar<'q, 'c, E, O>(
&self,
executor: E,
field: &'q Column,
) -> Result<Option<O>, Error>
async fn optional_scalar<'q, 'c, E, O>( &self, executor: E, field: &'q Column, ) -> Result<Option<O>, Error>
获取一个可选标量,如果不存在返回 None
Source§async fn all_scalars<'q, 'c, E, O>(
&self,
executor: E,
field: &'q Column,
) -> Result<Vec<O>, Error>
async fn all_scalars<'q, 'c, E, O>( &self, executor: E, field: &'q Column, ) -> Result<Vec<O>, Error>
获取全部标量
Source§async fn page_scalars<'e, 'c: 'e, E, O>(
&self,
executor: E,
field: &'c Column,
page: &PageRequest,
) -> Result<PageResult<O>, Error>
async fn page_scalars<'e, 'c: 'e, E, O>( &self, executor: E, field: &'c Column, page: &PageRequest, ) -> Result<PageResult<O>, Error>
分页获取标量
Source§impl<'a> WhereAppend<Condition> for SelectBuilder<'a>
impl<'a> WhereAppend<Condition> for SelectBuilder<'a>
Auto Trait Implementations§
impl<'a> Freeze for SelectBuilder<'a>
impl<'a> RefUnwindSafe for SelectBuilder<'a>
impl<'a> Send for SelectBuilder<'a>
impl<'a> Sync for SelectBuilder<'a>
impl<'a> Unpin for SelectBuilder<'a>
impl<'a> UnwindSafe for SelectBuilder<'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
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