Skip to main content

Crate reddb_rql

Crate reddb_rql 

Source
Expand description

reddb-io-rql — the RedDB Query Language (RQL) front-end + conformance authority (ADR 0053).

This crate owns the RQL language front-end: lexer, parser, AST, mode translators, analyzer, typing, storage-agnostic optimizer, and the sqllogictest-format conformance corpus whose truth comes from the public SQLite corpus plus RedDB-authored extensions.

The crate sits near the bottom of the workspace graph: it depends only on reddb_types (the neutral keystone, ADR 0052) and on nothing else in the workspace. Server-backed conformance drivers live in the umbrella package’s integration tests and execute this crate’s corpus against the current in-server engine, so pure reddb-io-rql coverage never pulls reddb-server or gRPC into the crate graph.

The one piece of conformance machinery that is genuinely storage-agnostic — and therefore lives in the library rather than the test harness — is the rendering of an engine reddb_types::Value into the textual cell the sqllogictest comparator sees. conformance owns that rendering.

Re-exports§

pub use conformance::render_cell;
pub use conformance::CellType;
pub use lexer::Lexer;
pub use lexer::LexerError;
pub use lexer::Position;
pub use lexer::Spanned;
pub use lexer::Token;
pub use limits::ParserLimits;
pub use parser::parse;
pub use parser::ParseError;
pub use parser::ParseErrorKind;
pub use parser::Parser;
pub use parser::SafeTokenDisplay;
pub use sql::parse_frontend;
pub use sql::FrontendStatement;
pub use sql::SqlCommand;
pub use sql::SqlStatement;

Modules§

analyzer
ast
Unified Query AST
conformance
Rendering of engine values into sqllogictest comparison cells.
expr_typing
Fase 3 expression typer.
filter_optimizer
Filter AST optimizer
knowledge
Agent-facing RQL knowledge reference — generated from the engine’s own authorities (ADR 0061, “Agent-Facing Knowledge & MCP Surface”).
lexer
RQL Lexer
limits
Front-end DoS limits.
modes
Multi-Mode Query Parser
optimizer
Query Optimizer
parser
RQL Parser
planner
Storage-agnostic logical planning + optimization (ADR 0053, #1106).
renderer
AST → SQL/RQL renderer (partial subset for property round-trip tests).
schema_expression
Persisted row expressions. Parse once at DDL/reopen, share the AST on writes.
sql
sql_lowering
stored_function
Persisted RQL function definitions; execution remains in the server crate.