Skip to main content

linkrs_query/
lib.rs

1// Query module for the graph database
2//
3// This module provides the complete query processing pipeline including:
4// - Parsing query strings into AST
5// - Planning and optimizing execution plans
6// - Executing queries against the storage engine
7// - Managing query contexts and validation
8
9// Sub-modules
10pub mod attached;
11pub mod binder;
12pub mod cache;
13pub mod context;
14pub mod cte;
15pub mod dml_events;
16pub mod executor;
17pub mod extensions;
18pub mod metadata;
19pub mod optimizer;
20pub mod parser;
21pub mod pipeline;
22pub mod planning;
23pub mod query_core;
24pub mod query_manager;
25pub mod session_events;
26
27// Re-export DataSet for convenience
28pub use linkrs_core::DataSet;
29// Re-export error types from core module
30pub use linkrs_core::{DBResult, QueryError};
31// Re-export execution result from executor module
32pub use executor::base::ExecutionResult;
33// Re-export QueryPipelineManager
34pub use pipeline::QueryPipelineManager;
35// Re-export context types from context module
36pub use context::{QueryContext, QueryContextBuilder, QueryRequestContext};
37// Re-export QueryManager
38pub use query_manager::{
39    QueryInfo, QueryManager, QueryProgress, QueryProgressCallback, QueryStatus,
40};
41// Re-export pipeline extensions.
42//
43// Unstable experimental API: the extension surface may evolve while the
44// pipeline integration matures.
45pub use extensions::{
46    BinderExtension, BinderExtensionContext, ExtensionRegistry, MapperExtension, ParserExtension,
47    PlannerExtension,
48};
49/// Unstable alias for the experimental pipeline-extension surface.
50///
51/// New code should import from here instead of `extensions` so future
52/// stabilization (or removal) has one obvious place to change. The alias
53/// re-exports everything in [`extensions`]; both paths refer to the same
54/// types.
55pub mod experimental_pipeline_extensions {
56    pub use super::extensions::*;
57}
58pub use dml_events::{classify_dml, DmlOp, DmlStatementCallback, DmlStatementEvent};
59pub use session_events::{SessionEvent, SessionEventCallback};
60// Re-export OptimizerEngine
61pub use optimizer::OptimizerEngine;
62
63// Application-layer hybrid retrieval helpers. Both search paths emit
64// identifier plus score rows independently; callers normalize vector point
65// IDs before fusion because vector and fulltext ID spaces differ.
66pub use linkrs_core::fusion::{
67    normalize_vector_hits, normalize_vector_point_id, rrf_fuse, weighted_fuse, FusedHit, ScoredHit,
68};
69
70pub mod storage {
71    pub use linkrs_storage::*;
72
73    #[cfg(test)]
74    pub use linkrs_storage::MockStorage;
75}