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 error;
13pub mod fmt;
14pub mod migrate;
15pub mod parser;
16pub mod schema;
17pub mod transformer;
18pub mod transpiler;
19pub mod validator;
20
21pub use parser::parse;
22
23/// Ergonomic alias for Qail - the primary query builder type.
24pub type Qail = ast::Qail;
25
26pub mod prelude {
27    pub use crate::ast::*;
28    pub use crate::ast::builders::{
29        // Column builders
30        col, param, star,
31        // Aggregate builders
32        count, count_distinct, count_filter, count_where, count_where_all,
33        sum, avg, max, min,
34        // Condition builders  
35        eq, ne, gt, gte, lt, lte, is_null, is_not_null, is_in, not_in, like, ilike,
36        cond,
37        // Literal builders
38        text, int, float, boolean, null, bind,
39        // Expression builders
40        cast, now, now_minus, now_plus, interval, binary, case_when,
41        // Function builders
42        coalesce, func, replace, nullif, concat,
43        // JSON builders
44        json, json_path, json_obj,
45        // Shortcut helpers
46        recent, recent_col, in_list, percentage, all, and, and3,
47        // Extension traits
48        ExprExt,
49    };
50
51    pub use crate::error::*;
52    pub use crate::parser::parse;
53    pub use crate::transpiler::ToSql;
54    pub use crate::Qail;
55}