Skip to main content

Crate qql

Crate qql 

Source
Expand description

QQL executor and Qdrant transport adapters (published as the qql crate).

One executor API over three transports:

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, …).

Re-exports§

pub use executor::PreparedStatement;

Modules§

backend
Transport-neutral collection metadata, re-exported from qql_protocol::schema.
client
The QdrantOps backend contract plus REST/gRPC client plumbing shared by the transport adapters.
config
Endpoint, API key, and timeout configuration (QqlConfig).
embedder
Remote embedding-server adapter (HttpEmbedder) implementing the qql-embed Embedder trait. Embedding adapters for the runtime.
executor
The executor: parse → prepare → plan → batch → dispatch.
grpc
Tonic channel client and typed protobuf conversions for the gRPC transport. gRPC transport for Qdrant (GrpcQdrant).
qdrant
Typify-generated REST wire types from openapi.json (build-time output; do not edit). Typify-generated REST types from openapi.json.
qdrant_grpc
Tonic-generated protobuf types from proto/ (build-time output; do not edit). Tonic-generated gRPC types from proto/.
rest
REST transport adapter (RestQdrant) implementing QdrantOps over JSON HTTP.
snapshots
Remote shard-snapshot client for edge bootstrap (REST only, not part of the QdrantOps contract). Remote shard-snapshot access for edge bootstrap (REST only).
sparse
Sparse vector helpers re-exported from qql-embed (wire-compatible BM25). Re-export shared sparse BM25 from qql-embed.

Structs§

CreateCollectionRequest
Plan IR for CREATE COLLECTION; projected to the OpenAPI body at the edge.
CreateIndexRequest
Plan IR for CREATE INDEX.
Parser
Canonical QQL parser facade.
QqlError
Unified error type for the entire QQL pipeline.
QueryBatchRequest
Wraps multiple QueryRequests for Qdrant’s /points/query/batch endpoint. All queries must target the same collection.
QuotaConfig
Cluster-wide resource quota configuration (GET/PUT /quotas).
Span
Source-code span as UTF-8 byte offsets into the query text.
UpdateBatchRequest
Wire body for Qdrant’s POST /collections/{c}/points/batch (mutation batch). Maps to OpenAPI UpdateOperations / gRPC UpdateBatchPoints.
UpdateCollectionRequest
Plan IR for ALTER COLLECTION; serializes as the OpenAPI PATCH body.

Enums§

ComparisonOp
Scalar comparison operator for field <op> value and VALUES_COUNT predicates.
ErrorKind
Broad category of error origin within the QQL pipeline.
PlanFacetValue
One facet value as returned by Qdrant: keyword, integer, or bool (OpenAPI FacetValue). Serializes untagged.
PlanGroupId
Group key of a grouped query result (OpenAPI GroupId): keyword, unsigned integer, or signed integer. Serializes untagged.
PlanPointId
Transport-neutral point ID: unsigned integer or string (typically UUID).
PlanShardKey
Transport-neutral custom shard key. Serializes as a JSON string or number so REST matches OpenAPI ExtendedPointId-style shard keys.
PlanVectorStruct
Vector(s) attached to a returned point: one unnamed vector or a named set.
PlanVectorValue
Transport-neutral vector value: dense, sparse, or multi-dense rows.
PlannedOperation
Canonical planned operation. Batch compatibility is determined from this type, not from raw AST.
Stmt
Top-level QQL statement parsed from a script.
Value
QQL literal value: string, number, bool, null, object, or list.
VectorValue
A vector value: dense, sparse, or multivector.

Functions§

inject_filter
Injects a typed field comparison into a statement (CTEs and prefetches included), fail-closed.