Skip to main content

Crate qql_core

Crate qql_core 

Source
Expand description

QQL language frontend: lexer, parser, typed AST, explain, and formatting.

qql-core is the single owner of the QQL language surface. It performs no I/O: no networking, no file access, and no knowledge of Qdrant REST JSON or gRPC protobuf shapes. Lowering to transports lives in qql-plan (transport-neutral plans plus an optional REST projection) and the executor crate qql (REST / gRPC / edge execution).

With default features the crate builds without third-party dependencies; serde and json are opt-in for AST serialization and dynamic-value conversion. Parser-only consumers — formatters, linters, language servers, code generators — therefore embed it cheaply.

§Entry points

  • parser::Parser — source text → typed Stmt AST with strict validation (Parser::parse_all for multi-statement scripts)
  • ast::inject_filter — inject a typed comparison into an existing AST
  • explain — tree-formatted statement dumps for humans
  • fmt — canonical formatter; output re-parses to an identical AST
  • params:name / ? placeholder binding and substitution

§Errors

Every failure is a structured error::QqlError carrying a stable code, an explicit ErrorKind, and a byte-offset Span.

Modules§

ast
Typed abstract syntax tree: statements, filter and formula expressions, values, and AST transforms.
error
Structured errors: stable codes, explicit ErrorKind, byte-offset spans.
explain
Tree-formatted statement explanations. Human-readable query plan inspection.
fmt
Canonical QQL formatter with parse → format → parse round-trip guarantees. Canonical QQL formatter.
lexer
Byte-offset lexer: source text → Token stream.
params
Parameter binding for :name / ? placeholders with type-checked substitution. Parameter binding and prepared query substitution.
parser
Recursive-descent parser: token stream → validated typed AST.
token
Lexical token kinds, spans, and keyword lookup tables.