11// lib/src/lib.rs
2- // Updated: 2025-07-02 - Refactored to use the new 'models' crate for shared types.
3- // Corrected unresolved imports for SledUserStorage and UserStorageEngine.
2+ // Updated: 2025-07-04 - Refactored to use new storage engine names and removed obsolete imports.
43
54#![ cfg_attr( feature = "bench-suite" , feature( test) ) ]
65
@@ -10,24 +9,23 @@ pub mod graph_evolution;
109pub mod network_interfaces;
1110pub mod plugin_system;
1211pub mod database;
13- pub mod memory;
14- // REMOVED: pub mod models; // Models are now in a separate crate!
12+ pub mod memory; // Now contains InMemoryGraphStorage
1513pub mod errors;
1614pub mod query_exec_engine;
1715pub mod storage_engine; // This declares the directory `storage_engine`
1816pub mod transact_indexing;
1917pub mod indexing_caching;
2018pub mod util;
2119
20+ // REMOVED: pub mod rdb; // Obsolete after RocksDB consolidation
21+
2222// Now, import directly from the 'models' crate.
23- // Ensure these are correctly named based on what `models/src/lib.rs` re-exports.
24- // For instance, if models::edges::Edge is simply re-exported as models::Edge, then `models::Edge` is correct.
25- pub use models:: { Edge , Identifier , Json } ;
23+ pub use models:: { Edge , Identifier , Json , Vertex } ; // Added Vertex here for convenience
2624
2725// Fix the imports by specifying the correct sub-modules
2826pub use models:: bulk_insert:: BulkInsertItem ;
29- pub use models:: queries:: EdgeDirection ; // CORRECTED PATH (as per previous fix)
30- pub use models:: properties:: { EdgeProperties , NamedProperty , PropertyValue , VertexProperties } ; // Keep this one for PropertyValue
27+ pub use models:: queries:: EdgeDirection ;
28+ pub use models:: properties:: { EdgeProperties , NamedProperty , PropertyValue , VertexProperties } ;
3129pub use models:: queries:: { Query , QueryOutputValue } ;
3230pub use models:: medical:: { Login , User } ;
3331
@@ -44,16 +42,14 @@ pub mod benches;
4442
4543// Explicit re-exports
4644pub use crate :: indexing_caching:: { index_node, cache_node_state, get_cached_node_state} ;
47- pub use crate :: database:: * ;
45+ pub use crate :: database:: * ; // Re-exports the main Database struct
4846pub use crate :: errors:: * ;
49- pub use crate :: memory:: * ;
50- // REMOVED: pub use models::PropertyValue; // <-- REMOVED THIS DUPLICATE LINE
47+ pub use crate :: memory:: InMemoryGraphStorage ; // Re-export the new in-memory storage
5148
52- // Re-export from storage_engine/mod.rs
53- // Removed SledUserStorage and UserStorageEngine as their definitions/re-exports are not available.
54- // If these are needed, ensure they are correctly defined and re-exported in storage_engine/mod.rs
55- // and storage_engine/user_storage.rs
49+ // Re-export from storage_engine/mod.rs (assuming it exists and re-exports these)
5650pub use crate :: storage_engine:: { open_sled_db, StorageEngine , GraphStorageEngine } ;
51+ #[ cfg( feature = "with-rocksdb" ) ]
52+ pub use crate :: storage_engine:: rocksdb_storage:: RocksdbGraphStorage ; // Re-export the new RocksDB storage
5753
5854
5955// Do NOT glob-import engine and models together to avoid ambiguity
@@ -63,33 +59,29 @@ pub mod api {
6359 Graph ,
6460 Edge as EngineEdge ,
6561 Vertex as EngineVertex ,
66- // CHECK THIS: If `engine::properties::PropertyValue` is distinct from `models::properties::PropertyValue`
67- // and needs to be exposed here. If not, consider removing or aliasing appropriately.
68- properties:: PropertyValue as EnginePropertyValue // Aliased to avoid conflict if both exist
62+ properties:: PropertyValue as EnginePropertyValue
6963 } ;
70- // Now, import ModelEdge, ModelVertex, Identifier, Json from the new `models` crate
71- pub use models:: { // Already imported at the top, just re-exporting under `api`
64+ pub use models:: {
7265 Edge as ModelEdge ,
7366 Vertex as ModelVertex ,
7467 Identifier ,
7568 Json
7669 } ;
7770}
7871
79- #[ cfg( feature = "sled-datastore" ) ]
80- pub mod sled; // This declares the 'sled' module, referring to src/sled/managers.rs (implicitly)
81-
82- #[ cfg( feature = "sled-datastore" ) ]
83- // Assuming your main Sled manager struct is named SledManager
84- // and you want to re-export it as 'SledDatastore' for consistency with the previous name
85- pub use crate :: sled:: managers:: SledManager as SledDatastore ;
86-
87- // If you had a mechanism to choose between datastores based on feature,
88- // you might then have a type alias or a trait implementation somewhere that uses it:
89-
90- // #[cfg(feature = "rocksdb-datastore")]
91- // pub type CurrentDatastore = RocksdbDatastore;
92-
93- #[ cfg( feature = "sled-datastore" ) ]
94- pub type CurrentDatastore = SledDatastore ;
72+ // The 'sled' module and 'SledDatastore' alias are likely obsolete if SledStorage
73+ // is directly used via `storage_engine`. Remove if not needed.
74+ // #[cfg(feature = "sled-datastore")]
75+ // pub mod sled; // This declares the 'sled' module, referring to src/sled/managers.rs (implicitly)
76+ // #[cfg(feature = "sled-datastore")]
77+ // pub use crate::sled::managers::SledManager as SledDatastore;
78+
79+ // Type alias for CurrentDatastore, now using GraphStorageEngine implementations
80+ #[ cfg( feature = "with-rocksdb" ) ]
81+ pub type CurrentGraphStorage = RocksdbGraphStorage ; // If RocksDB is enabled, use it
82+ #[ cfg( not( feature = "with-rocksdb" ) ) ]
83+ pub type CurrentGraphStorage = InMemoryGraphStorage ; // Otherwise, default to in-memory (or Sled if preferred)
84+
85+ // You might also want a default for when no feature is enabled, e.g.:
86+ // pub type CurrentGraphStorage = SledStorage; // Assuming Sled is always available
9587
0 commit comments