Skip to main content

uni_db/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2024-2026 Dragonscale Team
3
4//! # Uni - Embedded Graph Database
5//!
6//! Uni is an embedded, object-store-backed graph database with OpenCypher queries,
7//! columnar analytics, and vector search.
8
9pub mod api;
10mod shutdown;
11
12pub use api::builder::PropertiesBuilder;
13pub use api::impl_locy::LocyEngine;
14pub use api::schema::{IndexType, ScalarType, VectorAlgo, VectorIndexCfg, VectorMetric};
15pub use api::sync::UniSync;
16pub use api::transaction::Transaction;
17pub use api::xervo::UniXervo;
18pub use api::{Uni, UniBuilder};
19
20// Re-exports from internal crates
21pub use uni_common::{
22    CrdtType, DataType, Eid, Result, Schema, UniConfig, UniError, UniId, Vid, unival,
23};
24pub use uni_query::{
25    Edge, ExecuteResult, ExplainOutput, FromValue, Node, Path, ProfileOutput, QueryResult,
26    QueryWarning, Row, Value,
27};
28
29#[cfg(feature = "storage-internals")]
30pub use uni_store::storage::StorageManager;
31
32#[cfg(feature = "snapshot-internals")]
33pub use uni_common::core::snapshot::SnapshotManifest;
34#[cfg(feature = "snapshot-internals")]
35pub use uni_store::snapshot::manager::SnapshotManager;
36
37// Re-export crates
38pub use uni_algo as algo_crate;
39pub use uni_common as common;
40pub use uni_query as query_crate;
41pub use uni_store as store;
42
43// Module aliases for internal crate access
44pub mod core {
45    pub use crate::common::core::*;
46}
47
48pub mod storage {
49    pub use crate::store::storage::*;
50    // Fix for tests expecting IndexManager in storage root or similar?
51    // tests use uni_db::storage::manager::StorageManager.
52    // crate::store::storage has manager.
53}
54
55pub mod runtime {
56    pub use crate::store::runtime::*;
57}
58
59pub mod query {
60    pub use crate::query_crate::query::*;
61}
62
63pub mod algo {
64    // Tests use uni_db::algo::* (from src/algo).
65    // uni-algo has `algo` module.
66    pub use crate::algo_crate::algo::*;
67}
68
69pub mod xervo {
70    pub use crate::api::xervo::*;
71}
72
73pub mod locy {
74    pub use crate::api::impl_locy::LocyEngine;
75    pub use uni_cypher::locy_ast::LocyProgram;
76    pub use uni_cypher::{ParseError, parse_locy};
77    pub use uni_locy::{
78        CommandResult, CompiledProgram, LocyCompileError, LocyConfig, LocyError, LocyResult,
79    };
80}