pub enum SqlTransform<Rel = RIId, Super = Transform> {
Show 13 variants Super(Super), From(Rel), Select(Vec<CId>), Filter(Expr), Aggregate { partition: Vec<CId>, compute: Vec<CId>, }, Sort(Vec<ColumnSort<CId>>), Take(Take), Join { side: JoinSide, with: Rel, filter: Expr, }, Distinct, DistinctOn(Vec<CId>), Except { bottom: Rel, distinct: bool, }, Intersect { bottom: Rel, distinct: bool, }, Union { bottom: Rel, distinct: bool, },
}
Expand description

Similar to rq::Transform, but closer to a SQL clause.

Uses two generic args that allows the compiler to work in multiple stages:

Variants§

§

Super(Super)

Contains rq::Transform during compilation. After finishing, this is emptied.

For example, initial an RQ Append transform is wrapped as such:

rq::Transform::Append(x) -> srq::SqlTransform::Super(rq::Transform::Append(x))

During preprocessing it is compiled to:

srq::SqlTransform::Super(rq::Transform::Append(_)) -> srq::SqlTransform::Union { .. }

At the end of SRQ compilation, all Super() are either discarded or converted to their SRQ equivalents.

§

From(Rel)

§

Select(Vec<CId>)

§

Filter(Expr)

§

Aggregate

Fields

§partition: Vec<CId>
§compute: Vec<CId>
§

Sort(Vec<ColumnSort<CId>>)

§

Take(Take)

§

Join

Fields

§with: Rel
§filter: Expr
§

Distinct

§

DistinctOn(Vec<CId>)

§

Except

Fields

§bottom: Rel
§distinct: bool
§

Intersect

Fields

§bottom: Rel
§distinct: bool
§

Union

Fields

§bottom: Rel
§distinct: bool

Implementations§

source§

impl<Rel, Super> SqlTransform<Rel, Super>

source

pub fn is_super(&self) -> bool

Returns true if this is a SqlTransform::Super, otherwise false

source

pub fn as_super_mut(&mut self) -> Option<&mut Super>

Optionally returns mutable references to the inner fields if this is a SqlTransform::Super, otherwise None

source

pub fn as_super(&self) -> Option<&Super>

Optionally returns references to the inner fields if this is a SqlTransform::Super, otherwise None

source

pub fn into_super(self) -> Result<Super, SqlTransform<Rel, Super>>

Returns the inner fields if this is a SqlTransform::Super, otherwise returns back the enum in the Err case of the result

source

pub fn is_from(&self) -> bool

Returns true if this is a SqlTransform::From, otherwise false

source

pub fn as_from_mut(&mut self) -> Option<&mut Rel>

Optionally returns mutable references to the inner fields if this is a SqlTransform::From, otherwise None

source

pub fn as_from(&self) -> Option<&Rel>

Optionally returns references to the inner fields if this is a SqlTransform::From, otherwise None

source

pub fn into_from(self) -> Result<Rel, SqlTransform<Rel, Super>>

Returns the inner fields if this is a SqlTransform::From, otherwise returns back the enum in the Err case of the result

source

pub fn is_select(&self) -> bool

Returns true if this is a SqlTransform::Select, otherwise false

source

pub fn as_select_mut(&mut self) -> Option<&mut Vec<CId>>

Optionally returns mutable references to the inner fields if this is a SqlTransform::Select, otherwise None

source

pub fn as_select(&self) -> Option<&Vec<CId>>

Optionally returns references to the inner fields if this is a SqlTransform::Select, otherwise None

source

pub fn into_select(self) -> Result<Vec<CId>, SqlTransform<Rel, Super>>

Returns the inner fields if this is a SqlTransform::Select, otherwise returns back the enum in the Err case of the result

source

pub fn is_filter(&self) -> bool

Returns true if this is a SqlTransform::Filter, otherwise false

source

pub fn as_filter_mut(&mut self) -> Option<&mut Expr>

Optionally returns mutable references to the inner fields if this is a SqlTransform::Filter, otherwise None

source

pub fn as_filter(&self) -> Option<&Expr>

Optionally returns references to the inner fields if this is a SqlTransform::Filter, otherwise None

source

pub fn into_filter(self) -> Result<Expr, SqlTransform<Rel, Super>>

Returns the inner fields if this is a SqlTransform::Filter, otherwise returns back the enum in the Err case of the result

source

pub fn is_aggregate(&self) -> bool

Returns true if this is a SqlTransform::Aggregate, otherwise false

source

pub fn as_aggregate_mut(&mut self) -> Option<(&mut Vec<CId>, &mut Vec<CId>)>

Optionally returns mutable references to the inner fields if this is a SqlTransform::Aggregate, otherwise None

source

pub fn as_aggregate(&self) -> Option<(&Vec<CId>, &Vec<CId>)>

Optionally returns references to the inner fields if this is a SqlTransform::Aggregate, otherwise None

source

pub fn into_aggregate( self ) -> Result<(Vec<CId>, Vec<CId>), SqlTransform<Rel, Super>>

Returns the inner fields if this is a SqlTransform::Aggregate, otherwise returns back the enum in the Err case of the result

source

pub fn is_sort(&self) -> bool

Returns true if this is a SqlTransform::Sort, otherwise false

source

pub fn as_sort_mut(&mut self) -> Option<&mut Vec<ColumnSort<CId>>>

Optionally returns mutable references to the inner fields if this is a SqlTransform::Sort, otherwise None

source

pub fn as_sort(&self) -> Option<&Vec<ColumnSort<CId>>>

Optionally returns references to the inner fields if this is a SqlTransform::Sort, otherwise None

source

pub fn into_sort(self) -> Result<Vec<ColumnSort<CId>>, SqlTransform<Rel, Super>>

Returns the inner fields if this is a SqlTransform::Sort, otherwise returns back the enum in the Err case of the result

source

pub fn is_take(&self) -> bool

Returns true if this is a SqlTransform::Take, otherwise false

source

pub fn as_take_mut(&mut self) -> Option<&mut Take>

Optionally returns mutable references to the inner fields if this is a SqlTransform::Take, otherwise None

source

pub fn as_take(&self) -> Option<&Take>

Optionally returns references to the inner fields if this is a SqlTransform::Take, otherwise None

source

pub fn into_take(self) -> Result<Take, SqlTransform<Rel, Super>>

Returns the inner fields if this is a SqlTransform::Take, otherwise returns back the enum in the Err case of the result

source

pub fn is_join(&self) -> bool

Returns true if this is a SqlTransform::Join, otherwise false

source

pub fn as_join_mut(&mut self) -> Option<(&mut JoinSide, &mut Rel, &mut Expr)>

Optionally returns mutable references to the inner fields if this is a SqlTransform::Join, otherwise None

source

pub fn as_join(&self) -> Option<(&JoinSide, &Rel, &Expr)>

Optionally returns references to the inner fields if this is a SqlTransform::Join, otherwise None

source

pub fn into_join( self ) -> Result<(JoinSide, Rel, Expr), SqlTransform<Rel, Super>>

Returns the inner fields if this is a SqlTransform::Join, otherwise returns back the enum in the Err case of the result

source

pub fn is_distinct(&self) -> bool

Returns true if this is a SqlTransform::Distinct, otherwise false

source

pub fn is_distinct_on(&self) -> bool

Returns true if this is a SqlTransform::DistinctOn, otherwise false

source

pub fn as_distinct_on_mut(&mut self) -> Option<&mut Vec<CId>>

Optionally returns mutable references to the inner fields if this is a SqlTransform::DistinctOn, otherwise None

source

pub fn as_distinct_on(&self) -> Option<&Vec<CId>>

Optionally returns references to the inner fields if this is a SqlTransform::DistinctOn, otherwise None

source

pub fn into_distinct_on(self) -> Result<Vec<CId>, SqlTransform<Rel, Super>>

Returns the inner fields if this is a SqlTransform::DistinctOn, otherwise returns back the enum in the Err case of the result

source

pub fn is_except(&self) -> bool

Returns true if this is a SqlTransform::Except, otherwise false

source

pub fn as_except_mut(&mut self) -> Option<(&mut Rel, &mut bool)>

Optionally returns mutable references to the inner fields if this is a SqlTransform::Except, otherwise None

source

pub fn as_except(&self) -> Option<(&Rel, &bool)>

Optionally returns references to the inner fields if this is a SqlTransform::Except, otherwise None

source

pub fn into_except(self) -> Result<(Rel, bool), SqlTransform<Rel, Super>>

Returns the inner fields if this is a SqlTransform::Except, otherwise returns back the enum in the Err case of the result

source

pub fn is_intersect(&self) -> bool

Returns true if this is a SqlTransform::Intersect, otherwise false

source

pub fn as_intersect_mut(&mut self) -> Option<(&mut Rel, &mut bool)>

Optionally returns mutable references to the inner fields if this is a SqlTransform::Intersect, otherwise None

source

pub fn as_intersect(&self) -> Option<(&Rel, &bool)>

Optionally returns references to the inner fields if this is a SqlTransform::Intersect, otherwise None

source

pub fn into_intersect(self) -> Result<(Rel, bool), SqlTransform<Rel, Super>>

Returns the inner fields if this is a SqlTransform::Intersect, otherwise returns back the enum in the Err case of the result

source

pub fn is_union(&self) -> bool

Returns true if this is a SqlTransform::Union, otherwise false

source

pub fn as_union_mut(&mut self) -> Option<(&mut Rel, &mut bool)>

Optionally returns mutable references to the inner fields if this is a SqlTransform::Union, otherwise None

source

pub fn as_union(&self) -> Option<(&Rel, &bool)>

Optionally returns references to the inner fields if this is a SqlTransform::Union, otherwise None

source

pub fn into_union(self) -> Result<(Rel, bool), SqlTransform<Rel, Super>>

Returns the inner fields if this is a SqlTransform::Union, otherwise returns back the enum in the Err case of the result

source§

impl<Rel> SqlTransform<Rel>

source

pub fn as_str(&self) -> &str

source

pub fn into_super_and<T, F>(self, f: F) -> Result<T, SqlTransform<Rel>>
where F: FnOnce(Transform) -> Result<T, Transform>,

Trait Implementations§

source§

impl<Rel, Super> AsRef<str> for SqlTransform<Rel, Super>

source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<Rel, Super> Clone for SqlTransform<Rel, Super>
where Rel: Clone, Super: Clone,

source§

fn clone(&self) -> SqlTransform<Rel, Super>

Returns a copy 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<Rel, Super> Debug for SqlTransform<Rel, Super>
where Rel: Debug, Super: Debug,

source§

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

Formats the value using the given formatter. Read more
source§

impl<Rel, Super> Serialize for SqlTransform<Rel, Super>
where Rel: Serialize, Super: Serialize,

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<Rel, Super> RefUnwindSafe for SqlTransform<Rel, Super>
where Rel: RefUnwindSafe, Super: RefUnwindSafe,

§

impl<Rel, Super> Send for SqlTransform<Rel, Super>
where Rel: Send, Super: Send,

§

impl<Rel, Super> Sync for SqlTransform<Rel, Super>
where Rel: Sync, Super: Sync,

§

impl<Rel, Super> Unpin for SqlTransform<Rel, Super>
where Rel: Unpin, Super: Unpin,

§

impl<Rel, Super> UnwindSafe for SqlTransform<Rel, Super>
where Rel: UnwindSafe, Super: 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
§

impl<T> Chain<T> for T

§

fn len(&self) -> usize

The number of items that this chain link consists of.
§

fn append_to(self, v: &mut Vec<T>)

Append the elements in this link to the chain.
§

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

§

type Iter = Once<T>

An iterator over the items within this container, by value.
§

fn get_iter(&self) -> <T as Container<T>>::Iter

Iterate over the elements of the container (using internal iteration because GATs are unstable).
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<T> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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<T> OrderedContainer<T> for T
where T: Clone,