Skip to main content

Crate uqa_sql

Crate uqa_sql 

Source
Expand description

SQL parser and compiler: PostgreSQL grammar via libpg_query, UQA function registry, expression evaluator, FTS query mini-language.

Re-exports§

pub use ast::ColumnType;
pub use ast::Statement;
pub use compiler::compile;
pub use compiler::plan_only_for_test;
pub use error::SQLError;
pub use fts_query::parse_query_string as parse_fts_query_string;
pub use fts_query::tokenize as fts_tokenize;
pub use fts_query::FTSNode;
pub use fts_query::FTSParser;
pub use fts_query::FTSToken;
pub use fts_query::FTSTokenType;
pub use params::SQLParam;
pub use result::ResultRow;
pub use result::SQLResult;

Modules§

ast
Internal SQL AST. Lifts the relevant subset of the libpg_query protobuf tree into a Rust enum the compiler walks. Statements not yet supported parse cleanly but compile to crate::SQLError::Unsupported.
compiler
Lift a PostgreSQL parse tree into the internal Statement AST.
error
Error types surfaced by the SQL compiler and executor.
expr
Scalar expression evaluator: turns an Expr into a Value under a row context (column -> value) and a parameter binding.
fts_query
Full-text search query-string parser.
params
Bind parameters for Engine::sql(query, params).
plpgsql
PL/pgSQL function bodies: typed AST, parser, and the variable binding rewriter.
registry
Function registry: maps SQL function names called inside WHERE / projections to UQA-side semantics (text match, vector knn, hybrid fusion, …).
result
Result rows returned by Engine::sql.

Traits§

AsyncSQLEngine
Common asynchronous SQL interface implemented by embedded and HTTP engines.