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_reservation, CatalogCacheRevisions, CatalogFacade, CatalogIndexRow,
58    ColumnStatsInput, ColumnStatsRow, EdgeRow, ForeignTableRow, GraphEntityFilter, GraphEntityKind,
59    GraphSnapshot, GraphVertexRow, RelationIdentity, RelationKind, RelationSecurityRow,
60    SchemaAclEntry, SchemaPrivileges, SchemaRow, SequenceAclEntry, SequenceOptions, SequenceOwner,
61    SequenceOwnerDependency, SequencePrivileges, SequenceReservationResult, SequenceRow,
62    SequenceSecurityRow, SequenceSetValueResult, SequenceValuePosition, SequenceValueReservation,
63    TableAclEntry, TablePrivileges, TableSchema, VectorFieldSchema, ViewRow, MAX_GRAPH_ID_PAGE,
64};
65pub use clustered_postings::{
66    MaterializedPostingCursor, PostingCursor, PostingScore, POSTING_CLUSTER_DOCS,
67};
68pub use document_store::{
69    DocumentMetadata, DocumentStore, MemoryDocumentStore, RetainedDocumentFields,
70    RetainedDocumentPage, RetainedDocumentStore, RetainedDocumentStoreBuilder,
71    RetainedStoredDocument, SharedDocumentRow, StoredDocument,
72};
73pub use hnsw_index::HNSWIndex;
74pub use index_abc::Index;
75pub use index_manager::{BTreeIndexHandle, IndexManager};
76pub use index_types::{IndexDef, IndexType};
77pub use inverted_index::{AnalyzerPhase, InvertedIndex, MemoryInvertedIndex};
78pub use ivf_index::{IVFIndex, IVFState};
79pub use key_value::{
80    KeyValueBatch, KeyValueCatalog, KeyValueDocumentStore, KeyValueInvertedIndex,
81    KeyValueStorageBackend, KeyValueStore, KeyValueVectorIndex, MemoryKeyValueStore,
82};
83pub use spatial_index::{haversine_distance, MemorySpatialIndex, SpatialIndex};
84pub use term_key::TokenTermKey;
85pub use transaction::{InMemoryTransaction, Snapshotable, TransactionError, TxResult};
86pub use vector_index::{
87    cosine_similarity, HNSWIndexParams, IVFIndexParams, MemoryVectorIndex, VectorIndex,
88    VectorIndexOpenMode, VectorIndexSpec,
89};
90
91mod fts_index_stat;
92pub use fts_index_stat::FtsIndexStat;