Expand description
Fluent QueryBuilder API on top of the SQL surface.
The builder composes a SELECT statement programmatically and
sends it through uqa_engine::Engine::sql. Infallible methods return
the builder by value; validated helpers return Result and remain
linearly chainable with ?:
use uqa_api::QueryBuilder;
use uqa_core::Value;
use uqa_engine::Engine;
let engine = Engine::new();
let result = QueryBuilder::new(&engine, "docs")
.select_columns(&["id", "_score"])
.where_gte("year", &Value::Int(2024))?
.knn_match("embedding", &[0.1, 0.2], 5)?
.order_by_desc("_score")
.limit(5)
.execute()?;The implementation is deliberately thin: it builds a SQL string
and lets the existing parser/engine path do the actual work. Typed
helpers cover common read and retrieval flows; callers can use raw
projection and predicate fragments where appropriate, while complete SQL
remains available through uqa_engine::Engine::sql.
Re-exports§
pub use query_builder::Order;pub use query_builder::QueryBuilder;
Modules§
- arrow_
export - Descriptor-directed Arrow output, independent of query-builder compatibility columns.
- query_
builder QueryBuilderassembles aSELECTstatement and runs it viauqa_engine::Engine::sql. Infallible methods return the builder by value, while helpers that validate SQL literals or retrieval options returnResult<Self, SQLError>and compose with?. The builder is transport-only; all real work happens in the engine’s SQL pipeline.
Functions§
- query
- Convenience entry point that builds a fluent
QueryBuilderscoped totableagainstengine.