mod bound;
pub use bound::*;
mod r#in;
pub use r#in::*;
mod exists;
pub use exists::*;
mod fn_call;
pub use fn_call::*;
mod like;
pub use like::*;
mod between;
pub use between::*;
mod binary;
pub use binary::*;
mod scalar;
pub use scalar::*;
mod lit;
pub use lit::*;
mod math;
pub use math::*;
mod json;
pub use json::*;
mod temporal;
pub use temporal::*;
mod grouped;
pub use grouped::*;
mod unary;
pub use unary::*;
mod r#as;
pub use r#as::*;
mod column;
pub use column::*;
use crate::{lower::LowerCtx, ty::TypeMeta};
pub trait Expression {
type Type: TypeMeta;
fn lower(&self, ctx: &mut LowerCtx) -> usize;
}
impl<E> Expression for &E
where
E: Expression,
{
type Type = E::Type;
fn lower(&self, ctx: &mut LowerCtx) -> usize {
E::lower(self, ctx)
}
}
pub trait AsExpression<T: TypeMeta> {
type Expression<'e>: Expression<Type = T>
where
Self: 'e;
fn as_expression<'e>(&'e self) -> Self::Expression<'e>;
}