1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! SQL interface for LLKV.
//!
//! This crate provides the [`SqlEngine`], which parses SQL statements and executes
//! them using the LLKV runtime. It serves as the primary user-facing interface for
//! interacting with LLKV databases.
//!
//! ```text
//! SQL String → sqlparser → AST → Plan → Runtime → Storage
//! ```
//!
//! The SQL engine:
//! 1. Parses SQL using [`sqlparser`]
//! 2. Converts AST to execution plans
//! 3. Delegates to `llkv-runtime` for execution
//! 4. Returns results as Arrow `RecordBatch` instances or row counts
//!
//! # Transactions
//!
//! By default, each statement executes in its own auto-commit transaction. Use
//! explicit transaction control for multi-statement transactions:
//!
//! # Type System
//!
//! SQL types are mapped to Arrow data types (the following is a non-exhaustive list):
//! - `INT`, `INTEGER`, `BIGINT` → `Int64`
//! - `FLOAT`, `DOUBLE`, `REAL` → `Float64`
//! - `TEXT`, `VARCHAR` → `Utf8`
//! - `DATE` → `Date32`
pub type SqlResult<T> = Result;
pub use ;
use SqlValue;
pub use ;
pub use ;
pub use ;
pub use TransactionKind;