Skip to main content

uqa_storage/
lib.rs

1//
2// Unified Query Algebra
3//
4// Copyright (c) 2023-2026 Cognica, Inc.
5//
6
7//! Persistent and in-memory backing stores for UQA: documents, inverted
8//! index, vector indexes (IVF), B-tree, in-memory spatial scan, block-max, and the
9//! provider-neutral catalog and transaction contracts.
10
11pub mod analyzer_binding;
12pub use analyzer_binding::{AnalyzerBindingOwner, BoundAnalyzerRevision, FieldAnalyzerBinding};
13
14pub mod backend;
15pub mod block_max_index;
16pub mod btree_index;
17pub mod catalog_index_keys;
18mod value_index_key;
19pub use value_index_key::{ValueIndexEntry, ValueIndexKey};
20pub mod catalog;
21pub mod clustered_postings;
22pub mod diskann_index;
23pub mod document_store;
24pub mod encryption_key;
25pub use encryption_key::StorageEncryptionKey;
26pub mod hnsw_index;
27pub mod index_abc;
28pub mod index_manager;
29pub mod index_types;
30pub mod inverted_index;
31pub mod ivf_index;
32pub mod key_value;
33pub mod mvcc;
34#[cfg(any(windows, all(unix, not(target_os = "emscripten"))))]
35#[allow(unsafe_code)]
36// Narrow OS file calls; callers retain descriptor ownership and local arbitration.
37pub mod native_file;
38pub mod notifications;
39pub mod read_control;
40mod read_only_snapshot;
41pub use read_only_snapshot::ReadOnlySnapshot;
42pub mod spatial_index;
43pub mod statistics_maintenance;
44pub mod temporary_file;
45pub mod term_key;
46pub mod transaction;
47pub mod vector_index;
48
49pub use backend::{
50    PersistentStorageBackend, PersistentStorageIdentity, PersistentStorageProvider,
51    PersistentStorageSession, StorageBackendError, StorageBackendResult, StorageSavepointId,
52    StorageSessionAffinity, StorageSessionMismatch, StorageTransactionModel,
53};
54pub use block_max_index::{BlockMaxIndex, BlockMaxScorer, DEFAULT_BLOCK_SIZE};
55pub use btree_index::BTreeIndex;
56pub use catalog::{
57    sequence_value_allocation, sequence_value_reservation, CatalogCacheRevisions, CatalogFacade,
58    CatalogIndexRow, ColumnStatsInput, ColumnStatsRow, EdgeRow, ForeignTableRow, GraphEntityFilter,
59    GraphEntityKind, GraphSnapshot, GraphVertexRow, RelationIdentity, RelationKind,
60    RelationSecurityRow, SchemaAclEntry, SchemaPrivileges, SchemaRow, SequenceAclEntry,
61    SequenceLogResult, SequenceOptions, SequenceOwner, SequenceOwnerDependency, SequencePrivileges,
62    SequenceReservationResult, SequenceRow, SequenceSecurityRow, SequenceSetValueResult,
63    SequenceValueAllocation, SequenceValuePosition, SequenceValueReservation, TableAclEntry,
64    TablePrivileges, TableSchema, VectorFieldSchema, ViewRow, MAX_GRAPH_ID_PAGE,
65};
66pub use clustered_postings::{
67    MaterializedPostingCursor, PostingCursor, PostingScore, POSTING_CLUSTER_DOCS,
68};
69pub use document_store::{
70    DocumentMetadata, DocumentStore, MemoryDocumentStore, RetainedDocumentFields,
71    RetainedDocumentPage, RetainedDocumentStore, RetainedDocumentStoreBuilder,
72    RetainedStoredDocument, SharedDocumentRow, StoredDocument,
73};
74pub use hnsw_index::HNSWIndex;
75pub use index_abc::Index;
76pub use index_manager::{BTreeIndexHandle, IndexManager};
77pub use index_types::{IndexDef, IndexType};
78pub use inverted_index::{AnalyzerPhase, InvertedIndex, MemoryInvertedIndex};
79pub use ivf_index::{IVFIndex, IVFState};
80pub use key_value::{
81    KeyValueBatch, KeyValueCatalog, KeyValueDocumentStore, KeyValueInvertedIndex,
82    KeyValueStorageBackend, KeyValueStore, KeyValueVectorIndex, MemoryKeyValueStore,
83};
84pub use spatial_index::{haversine_distance, MemorySpatialIndex, SpatialIndex};
85pub use term_key::TokenTermKey;
86pub use transaction::{InMemoryTransaction, Snapshotable, TransactionError, TxResult};
87pub use vector_index::{
88    cosine_similarity, HNSWIndexParams, IVFIndexParams, MemoryVectorIndex, VectorIndex,
89    VectorIndexOpenMode, VectorIndexSpec,
90};
91
92mod fts_index_stat;
93pub use fts_index_stat::FtsIndexStat;