uorm 0.9.0

Rust 下的轻量级 ORM 框架,借鉴了 Java MyBatis 的设计理念,强调 SQL 与业务逻辑分离。它结合 Rust 的类型系统与宏机制,支持编写原生 SQL 并自动映射结果,兼容 async/await,兼顾性能与可控性。
Documentation
use crate::udbc::value::Value;

#[derive(Debug, Clone, PartialEq)]
pub enum Op {
    Eq,
    Ne,
    Gt,
    Ge,
    Lt,
    Le,
    And,
    Or,
}

#[derive(Debug, Clone, PartialEq)]
pub enum Expr {
    Literal(Value),
    Var(String),
    Binary(Op, Box<Expr>, Box<Expr>),
}

#[derive(Debug, Clone)]
pub enum AstNode {
    Text(String),
    Var(String),
    Include {
        refid: String,
    },
    If {
        test: Expr,
        body: Vec<AstNode>,
    },
    Foreach {
        item: String,
        collection: String,
        open: String,
        separator: String,
        close: String,
        body: Vec<AstNode>,
    },
}