Skip to main content

DynSelect

Struct DynSelect 

Source
pub struct DynSelect<D, Output> { /* private fields */ }
Expand description

The one unavoidable escape hatch in this design: a single static type cannot mean “this table is joined” in one branch of an if and “it isn’t” in another. Only the join skeleton is erased. Every column reference was already checked against a concrete Scope before .erase(), and predicates keep the same closed ExprKind/Value representation used everywhere else, with no Box<dyn _> involved.

Composition happens before erasure, which is why DynSelect offers no further .filter()/.join(). It exists only to let two fully-built branches with different join topology unify into one value.

Implementations§

Source§

impl<D, Output> DynSelect<D, Output>

Source

pub fn limit(self, n: impl IntoRowCount) -> Self

LIMIT/OFFSET survive erasure because they reference nothing: a row count needs no proof that a table is joined. order_by doesn’t follow them here. A sort key is a column reference, and the scope that would justify it is exactly what .erase() gave up.

Source

pub fn offset(self, n: impl IntoRowCount) -> Self

Source§

impl<D: Dialect, Output> DynSelect<D, Output>

Source

pub fn count_sql(&self, _dialect: D) -> (String, Vec<Value>)

The same total Select::count_sql renders. Paging is the reason LIMIT/OFFSET survive erasure, and a page needs a total.

Source

pub fn to_sql(&self, _dialect: D) -> (String, Vec<Value>)

Auto Trait Implementations§

§

impl<D, Output> Freeze for DynSelect<D, Output>

§

impl<D, Output> RefUnwindSafe for DynSelect<D, Output>

§

impl<D, Output> Send for DynSelect<D, Output>

§

impl<D, Output> Sync for DynSelect<D, Output>

§

impl<D, Output> Unpin for DynSelect<D, Output>

§

impl<D, Output> UnsafeUnpin for DynSelect<D, Output>

§

impl<D, Output> UnwindSafe for DynSelect<D, Output>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<S> Superset<Nil, Nil> for S

Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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<T> WrapNullable<NotNull> for T