Skip to main content

Select

Struct Select 

Source
pub struct Select<Out, Loads = NoLoad, Lock = NoRowLock, DistinctState = NotDistinct, GroupState = NotGrouped> { /* private fields */ }

Implementations§

Source§

impl<Out> Select<Out, NoLoad, NoRowLock, NotDistinct, NotGrouped>

Source

pub fn new(table: Table) -> Self

Source§

impl<Out, Loads, Lock, DistinctState, GroupState> Select<Out, Loads, Lock, DistinctState, GroupState>

Source

pub fn table(&self) -> Table

Source

pub fn columns_ref(&self) -> Option<&[SelectItem]>

Source

pub fn joins(&self) -> &[Join]

Source

pub fn select_only(self) -> Self

Source

pub fn column<T>(self, expr: impl IntoExpr<T>) -> Self

Source

pub fn column_as<T>(self, expr: impl IntoExpr<T>, alias: &str) -> Self

Source

pub fn filter(self, expr: Expr<bool>) -> Self

Source

pub fn join<R>(self, rel: R) -> Self
where R: RelationInfo<Parent = Out>,

Source

pub fn left_join<R>(self, rel: R) -> Self
where R: RelationInfo<Parent = Out>,

Source

pub fn join_on(self, table: Table, on: Expr<bool>) -> Self

Source

pub fn left_join_on(self, table: Table, on: Expr<bool>) -> Self

Source

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

Source

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

Source

pub fn order_by(self, order: Order) -> Self

Source

pub fn columns(self, columns: Vec<ColumnRef>) -> Self

Source

pub fn into_model<T>(self) -> Select<T, Loads, Lock, DistinctState, GroupState>

Source

pub fn with<L>( self, load: L, ) -> Select<L::Out2, LoadChain<Loads, L>, Lock, DistinctState, GroupState>
where L: ApplyLoad<Out>,

Source

pub fn compile(&self) -> CompiledSql

Source

pub fn compile_without_pagination(&self) -> CompiledSql

Source

pub fn compile_with_extra( &self, extra_columns: &[SelectItem], extra_joins: &[Join], ) -> CompiledSql

Source

pub fn debug_sql(&self) -> String

Source

pub fn into_parts(self) -> (CompiledSql, Loads)

Source

pub fn into_parts_with_loads( self, ) -> (Select<Out, NoLoad, Lock, DistinctState, GroupState>, Loads)

Source§

impl<Out, Loads, DistinctState, GroupState> Select<Out, Loads, NoRowLock, DistinctState, GroupState>

Source

pub fn group_by<T>( self, expr: impl IntoExpr<T>, ) -> Select<Out, Loads, NoRowLock, DistinctState, Grouped>

Source

pub fn having( self, expr: Expr<bool>, ) -> Select<Out, Loads, NoRowLock, DistinctState, Grouped>

Source§

impl<Out, Loads, GroupState> Select<Out, Loads, NoRowLock, NotDistinct, GroupState>

Source

pub fn distinct( self, ) -> Select<Out, Loads, NoRowLock, DistinctSelected, GroupState>

Source§

impl<Out, Loads> Select<Out, Loads, NoRowLock, NotDistinct, NotGrouped>

Source§

impl<Out, Loads, GroupState> Select<Out, Loads, NoRowLock, DistinctSelected, GroupState>

Source

pub fn distinct(self) -> Self

Source§

impl<Out, Loads> Select<Out, Loads, ForUpdateRowLock, NotDistinct, NotGrouped>

Source

pub fn for_update(self) -> Self

Source

pub fn skip_locked(self) -> Self

Source

pub fn nowait(self) -> Self

Trait Implementations§

Source§

impl<Out: Clone, Loads: Clone, Lock: Clone, DistinctState: Clone, GroupState: Clone> Clone for Select<Out, Loads, Lock, DistinctState, GroupState>

Source§

fn clone(&self) -> Select<Out, Loads, Lock, DistinctState, GroupState>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Out: Debug, Loads: Debug, Lock: Debug, DistinctState: Debug, GroupState: Debug> Debug for Select<Out, Loads, Lock, DistinctState, GroupState>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Out, Loads, Lock, DistinctState, GroupState> Freeze for Select<Out, Loads, Lock, DistinctState, GroupState>
where Loads: Freeze,

§

impl<Out, Loads, Lock, DistinctState, GroupState> RefUnwindSafe for Select<Out, Loads, Lock, DistinctState, GroupState>
where Loads: RefUnwindSafe, Out: RefUnwindSafe, Lock: RefUnwindSafe, DistinctState: RefUnwindSafe, GroupState: RefUnwindSafe,

§

impl<Out, Loads, Lock, DistinctState, GroupState> Send for Select<Out, Loads, Lock, DistinctState, GroupState>
where Loads: Send, Out: Send, Lock: Send, DistinctState: Send, GroupState: Send,

§

impl<Out, Loads, Lock, DistinctState, GroupState> Sync for Select<Out, Loads, Lock, DistinctState, GroupState>
where Loads: Sync, Out: Sync, Lock: Sync, DistinctState: Sync, GroupState: Sync,

§

impl<Out, Loads, Lock, DistinctState, GroupState> Unpin for Select<Out, Loads, Lock, DistinctState, GroupState>
where Loads: Unpin, Out: Unpin, Lock: Unpin, DistinctState: Unpin, GroupState: Unpin,

§

impl<Out, Loads, Lock, DistinctState, GroupState> UnsafeUnpin for Select<Out, Loads, Lock, DistinctState, GroupState>
where Loads: UnsafeUnpin,

§

impl<Out, Loads, Lock, DistinctState, GroupState> UnwindSafe for Select<Out, Loads, Lock, DistinctState, GroupState>
where Loads: UnwindSafe, Out: UnwindSafe, Lock: UnwindSafe, DistinctState: UnwindSafe, GroupState: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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

Source§

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

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more