gluesql-core 0.20.0

GlueSQL - Open source SQL database engine fully written in Rust with pure functional execution layer, easily swappable storage and web assembly support!
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{ast::Expr, plan::ExprPlan, query_builder::ExprNode, result::Result};

#[derive(Clone, Debug)]
pub struct ExprWithAliasNode<'a> {
    pub expr: ExprNode<'a>,
    pub alias: String,
}

impl ExprWithAliasNode<'_> {
    pub(super) fn build_expr_with_alias_plan(self) -> Result<(ExprPlan, String)> {
        Ok((self.expr.build_expr_plan()?, self.alias))
    }

    pub(super) fn build_expr_with_alias(self) -> Result<(Expr, String)> {
        Ok((self.expr.build_expr()?, self.alias))
    }
}