qail_core/
lib.rs

1//! Type-safe SQL query builder with AST-native design.
2//!
3//! Build queries as typed AST, not strings. Zero SQL injection risk.
4//!
5//! ```ignore
6//! use qail_core::ast::{Qail, Operator};
7//! let cmd = Qail::get("users").column("name").filter("active", Operator::Eq, true);
8//! ```
9
10pub mod analyzer;
11pub mod ast;
12pub mod build;
13pub mod codegen;
14pub mod error;
15pub mod fmt;
16pub mod migrate;
17pub mod parser;
18pub mod schema;
19pub mod transformer;
20pub mod transpiler;
21pub mod typed;
22pub mod validator;
23
24pub use parser::parse;
25
26/// Ergonomic alias for Qail - the primary query builder type.
27pub type Qail = ast::Qail;
28
29pub mod prelude {
30    pub use crate::ast::*;
31    pub use crate::ast::builders::{
32        // Column builders
33        col, param, star,
34        // Aggregate builders
35        count, count_distinct, count_filter, count_where, count_where_all,
36        sum, avg, max, min,
37        // Condition builders  
38        eq, ne, gt, gte, lt, lte, is_null, is_not_null, is_in, not_in, like, ilike,
39        cond,
40        // Literal builders
41        text, int, float, boolean, null, bind,
42        // Expression builders
43        cast, now, now_minus, now_plus, interval, binary, case_when,
44        // Function builders
45        coalesce, func, replace, nullif, concat,
46        // JSON builders
47        json, json_path, json_obj,
48        // Shortcut helpers
49        recent, recent_col, in_list, percentage, all, and, and3,
50        // Extension traits
51        ExprExt,
52    };
53
54    pub use crate::error::*;
55    pub use crate::parser::parse;
56    pub use crate::transpiler::ToSql;
57    pub use crate::Qail;
58}