qql 0.5.0

QQL runtime and executor for Qdrant REST and gRPC
Documentation
//! QQL executor and Qdrant transport adapters (published as the `qql` crate).
//!
//! One executor API over three transports:
//!
//! ```text
//! source text
//!   → qql-core: parse + semantic validation
//!   → prepare: schema USING resolution + embedding inference (qql-embed)
//!   → qql-plan: plan() → PlannedOperation (transport-neutral IR)
//!   → batch classification / dispatch
//!   → REST (rest) | gRPC (grpc) | in-process edge (qql-edge)
//! ```
//!
//! Backends implement the [`client::QdrantOps`] contract (11 methods); the
//! [`executor::Executor`] drives it. DDL flows through the same planner as
//! DML. The gRPC path converts typed plan structs directly to protobuf —
//! query vectors, point IDs, DDL request configs, and formula expressions
//! never take a JSON detour.
//!
//! # Features
//!
//! - `rest` (default) — HTTP transport adapter ([`rest::RestQdrant`])
//! - `grpc` (default) — tonic-based gRPC transport ([`grpc::GrpcQdrant`])
//! - With both disabled, custom [`client::QdrantOps`] implementations still
//!   compile against the executor with no transport dependency.
//!
//! # Public API re-exports
//!
//! Types named in this crate's signatures — [`QqlError`], [`Stmt`],
//! [`PlannedOperation`], the batch and DDL request types — plus the policy
//! flow ([`Parser`], [`inject_filter`], [`ComparisonOp`], [`Value`]) are
//! re-exported here, so `QdrantOps` implementors and policy authors depend on
//! `qql` alone. Deeper IR introspection is advanced territory; add
//! `qql-plan` / `qql-core` directly when you need it.
//!
//! # Errors
//!
//! Execution failures are structured `QqlError` values from `qql-core` with
//! stable codes (`QQL-EXECUTION-*`, `QQL-TRANSPORT-*`, `QQL-BACKEND`, …).

pub mod backend;
/// The `QdrantOps` backend contract plus REST/gRPC client plumbing shared by
/// the transport adapters.
pub mod client;
/// Endpoint, API key, and timeout configuration ([`QqlConfig`](config::QqlConfig)).
pub mod config;
/// Remote embedding-server adapter ([`HttpEmbedder`](embedder::HttpEmbedder))
/// implementing the `qql-embed` [`Embedder`](embedder::Embedder) trait.
pub mod embedder;
/// Reqwest `HttpEmbedder` client, split from [`embedder`].
#[cfg(feature = "rest")]
mod embedder_http;
/// The executor: parse → prepare → plan → batch → dispatch.
pub mod executor;
/// Tonic channel client and typed protobuf conversions for the gRPC transport.
#[cfg(feature = "grpc")]
pub mod grpc;
/// gRPC route execution: typed plan structs converted directly to protobuf.
#[cfg(feature = "grpc")]
mod grpc_route;
/// Typify-generated REST wire types from `openapi.json` (build-time output;
/// do not edit).
pub mod qdrant;
/// Tonic-generated protobuf types from `proto/` (build-time output; do not
/// edit).
#[cfg(feature = "grpc")]
pub mod qdrant_grpc;
/// REST transport adapter ([`RestQdrant`](rest::RestQdrant)) implementing
/// `QdrantOps` over JSON HTTP.
#[cfg(feature = "rest")]
pub mod rest;
/// REST client construction (`RestQdrant` constructors), split from [`rest`].
#[cfg(feature = "rest")]
mod rest_client;
/// Strict per-operation REST response parsing (OpenAPI shapes only, no
/// fallbacks). Used exclusively by the REST transport.
#[cfg(feature = "rest")]
mod rest_response;
/// Remote shard-snapshot client for edge bootstrap (REST only, not part of
/// the `QdrantOps` contract).
#[cfg(feature = "rest")]
pub mod snapshots;
/// Sparse vector helpers re-exported from `qql-embed` (wire-compatible BM25).
pub mod sparse;

// Public-API re-exports (Rust API guidelines C-REEXPORT): every type named in
// this crate's public signatures, plus the parse → inject policy flow, is
// reachable through `qql` alone — backend and policy authors need no direct
// `qql-core` / `qql-plan` dependency.
pub use executor::PreparedStatement;
pub use qql_core::ast::{ComparisonOp, Stmt, Value, VectorValue, inject_filter};
pub use qql_core::error::{ErrorKind, QqlError, Span};
pub use qql_core::parser::Parser;
pub use qql_plan::{
    CreateCollectionRequest, CreateIndexRequest, PlanFacetValue, PlanGroupId, PlanPointId,
    PlanShardKey, PlanVectorStruct, PlanVectorValue, PlannedOperation, QueryBatchRequest,
    QuotaConfig, UpdateBatchRequest, UpdateCollectionRequest,
};

// Sparse unit tests live in `qql-embed` (shared implementation).

// Contract tests exercise the typed gRPC route converters alongside the
// OpenAPI REST schemas; gRPC is required for the parity half.
#[cfg(all(test, feature = "grpc"))]
mod contract_test;
#[cfg(test)]
mod executor_test;