Skip to main content

qql_plan/
lib.rs

1//! Transport-neutral planning: AST → [`PlannedOperation`].
2//!
3//! Architecture:
4//! - [`plan::plan`] is the sole statement → IR entry point.
5//! - [`plan::to_rest_route`] is an **optional** REST projection (proxies / offline compile).
6//! - Embeddings are owned by `qql-embed`, not this crate.
7
8extern crate alloc;
9
10/// Batch grouping, extraction, and validation for multi-statement execution.
11pub mod batch;
12mod bind;
13/// DDL lowering: collection, index, and shard-key statements into plan requests.
14pub mod ddl;
15mod ddl_rest;
16mod ddl_types;
17/// Filter lowering into OpenAPI-shaped `Filter` condition structures.
18pub mod filter;
19mod filter_types;
20mod formula_types;
21/// Payload index request types (`CREATE INDEX`).
22mod index_types;
23/// Mutation lowering: upsert, delete, and payload/vector updates into wire bodies.
24pub mod mutation;
25mod mutation_types;
26mod params;
27pub mod plan;
28mod point_id_validate;
29mod prefetch;
30/// Query lowering: `QUERY` statements into `/points/query` request bodies.
31pub mod query;
32mod query_types;
33mod rerank;
34/// Optional REST route projection and the offline `compile_statement` entry point.
35pub mod routing;
36pub mod semantic;
37/// AST → plan and plan → wire conversions for [`semantic`] primitives.
38mod semantic_conv;
39/// Wire and plan-IR request types shared by the REST projection and gRPC conversion.
40pub mod types;
41mod validate;
42pub(crate) mod value_serde;
43
44pub use batch::BatchGrouper;
45pub use formula_types::{FormulaDefault, PlanDecayKind, PlanFormula};
46pub use plan::{
47    BatchFamily, BatchKey, BatchOpts, PlannedOperation, RestProjectionError, batch_item_error,
48    build_query_batch, build_update_batch, ensure_no_unbound_params, into_query_batch,
49    into_update_batch, parse_and_plan, plan, plan_template, statement_batch_key, statement_wait,
50    to_rest_route, try_route, verify_batch_cardinality,
51};
52pub use routing::{CompiledStatement, compile_statement};
53pub use semantic::{
54    PlanFacetValue, PlanGroupId, PlanPointId, PlanPointVectors, PlanQueryInput, PlanShardKey,
55    PlanVectorStruct, PlanVectorValue,
56};
57pub use types::*;
58pub use value_serde::value_error_text;