Skip to main content

vlorql_core/
lib.rs

1//! Core data types, validators, and SQL compilation for VlorQl.
2//!
3//! This crate implements the *plan-then-execute* boundary described
4//! in the VlorQl design notes:
5//!
6//! * The LLM only ever emits a [`QueryPlan`](schema::QueryPlan) (a typed JSON object).
7//! * [`validate::ValidationPipeline`] runs schema, policy, operand,
8//!   and dialect validation on the plan and aggregates every
9//!   violation into a single [`errors::ValidationErrors`].
10//! * [`compile::QueryBuilder`] turns a validated plan into
11//!   parameterized SQL, delegating dialect-specific syntax to a
12//!   [`compile::SqlCompiler`] implementation.
13//!
14//! The crate has no I/O dependencies and can be used standalone
15//! (e.g. to construct or inspect plans in unit tests) or as the
16//! foundation of the higher-level [`vlorql`](https://docs.rs/vlorql)
17//! facade.
18
19#![deny(missing_docs)]
20
21pub mod cache;
22pub mod compile;
23pub mod errors;
24pub mod execute;
25pub(crate) mod fix;
26pub mod function;
27pub mod observability;
28pub mod optimizer;
29pub mod policy;
30pub mod prompt;
31pub(crate) mod query;
32pub mod schema;
33pub mod statistics;
34pub mod validate;
35
36/// Initialise the function registry with built-in functions.
37///
38/// Should be called once during program startup (e.g. from the
39/// application's `main` or the `vlorql` facade's `build` method).
40pub fn init_function_registry() {
41    function::init_registry(function::builtin::builtin_functions());
42}