Skip to main content

reddb_rql/
lib.rs

1//! `reddb-io-rql` — the RedDB Query Language (RQL) front-end + conformance
2//! authority (ADR 0053).
3//!
4//! This crate owns the RQL language front-end: lexer, parser, AST, mode
5//! translators, analyzer, typing, storage-agnostic optimizer, and the
6//! sqllogictest-format conformance corpus whose truth comes from the public
7//! SQLite corpus plus RedDB-authored extensions.
8//!
9//! The crate sits near the bottom of the workspace graph: it depends only on
10//! [`reddb_types`] (the neutral keystone, ADR 0052) and on nothing else in the
11//! workspace. Server-backed conformance drivers live in the umbrella package's
12//! integration tests and execute this crate's corpus against the current
13//! in-server engine, so pure `reddb-io-rql` coverage never pulls
14//! `reddb-server` or gRPC into the crate graph.
15//!
16//! The one piece of conformance machinery that is genuinely storage-agnostic —
17//! and therefore lives in the library rather than the test harness — is the
18//! rendering of an engine [`reddb_types::Value`] into the textual cell the
19//! sqllogictest comparator sees. [`conformance`] owns that rendering.
20
21// The parser family (#1103) and the AST cluster (#1113) were re-homed
22// byte-faithfully from `reddb-server`. Keep the legacy dead-code and import
23// allowances for that public surface, while requiring unused bindings to be
24// explicit (matching the precedent set by `reddb-io-types`, ADR 0052).
25#![allow(clippy::unwrap_used)]
26#![allow(dead_code, unused_imports)]
27// The parser dispatch carries deep recursive-descent signatures the source
28// crate already opted out of linting; mirror that subset so the move stays a
29// pure relocation rather than a refactor.
30#![allow(
31    clippy::too_many_arguments,
32    clippy::type_complexity,
33    clippy::should_implement_trait,
34    clippy::new_without_default,
35    // Legacy allow for the too_many_lines ratchet (PRD #1252): pre-existing
36    // parser/lexer functions exceed the 120-line threshold. The lint bites on
37    // new/changed code; remove once these functions are split up.
38    clippy::too_many_lines,
39    // Legacy allow for the cast_possible_truncation ratchet (PRD #1252):
40    // pre-existing truncating `as` casts on lengths/offsets. The lint bites on
41    // new/changed code; remove once those casts become checked conversions.
42    clippy::cast_possible_truncation
43)]
44
45pub mod analyzer;
46pub mod ast;
47pub mod conformance;
48pub mod expr_typing;
49pub mod filter_optimizer;
50pub mod knowledge;
51pub mod lexer;
52pub mod limits;
53pub mod modes;
54pub mod optimizer;
55pub mod parser;
56pub mod planner;
57pub mod renderer;
58pub mod schema_expression;
59pub mod sql;
60pub mod sql_lowering;
61pub mod stored_function;
62
63pub use conformance::{render_cell, CellType};
64pub use lexer::{Lexer, LexerError, Position, Spanned, Token};
65pub use limits::ParserLimits;
66pub use parser::{parse, ParseError, ParseErrorKind, Parser, SafeTokenDisplay};
67pub use sql::{parse_frontend, FrontendStatement, SqlCommand, SqlStatement};