pub struct FoldDB { /* private fields */ }Expand description
The main database coordinator that manages schemas, permissions, and data storage.
Implementations§
Source§impl FoldDB
impl FoldDB
Sourcepub fn get_node_id(&self) -> Result<String, Error>
pub fn get_node_id(&self) -> Result<String, Error>
Retrieves or generates and persists the node identifier.
Sourcepub fn get_schema_permissions(&self, node_id: &str) -> Vec<String>
pub fn get_schema_permissions(&self, node_id: &str) -> Vec<String>
Retrieves the list of permitted schemas for the given node.
Sourcepub fn set_schema_permissions(
&self,
node_id: &str,
schemas: &[String],
) -> Result<()>
pub fn set_schema_permissions( &self, node_id: &str, schemas: &[String], ) -> Result<()>
Sets the permitted schemas for the given node.
Sourcepub fn close(&self) -> Result<(), Error>
pub fn close(&self) -> Result<(), Error>
Properly close and flush the database to release all file locks
Sourcepub fn new(path: &str) -> Result<Self>
pub fn new(path: &str) -> Result<Self>
Creates a new FoldDB instance with the specified storage path. All initializations happen here. This is the main entry point for the FoldDB system. Do not initialize anywhere else. updated by @tomtang2
Sourcepub async fn new_with_s3(config: S3Config) -> Result<Self, StorageError>
pub async fn new_with_s3(config: S3Config) -> Result<Self, StorageError>
Creates a new FoldDB instance with S3-backed storage. The database is downloaded from S3 on initialization and can be synced back with flush_to_s3().
Sourcepub async fn flush_to_s3(&self) -> Result<(), StorageError>
pub async fn flush_to_s3(&self) -> Result<(), StorageError>
Flushes local Sled database and syncs to S3 (if S3 storage is configured)
Sourcepub fn has_s3_storage(&self) -> bool
pub fn has_s3_storage(&self) -> bool
Returns true if this FoldDB instance is configured with S3 storage
Sourcepub fn get_indexing_status(&self) -> IndexingStatus
pub fn get_indexing_status(&self) -> IndexingStatus
Get the current indexing status
Sourcepub fn is_indexing(&self) -> bool
pub fn is_indexing(&self) -> bool
Check if indexing is currently in progress
Sourcepub fn load_schema_from_json(
&mut self,
json_str: &str,
) -> Result<(), SchemaError>
pub fn load_schema_from_json( &mut self, json_str: &str, ) -> Result<(), SchemaError>
Load schema from JSON string (creates Available schema)
Sourcepub fn load_schema_from_file<P: AsRef<Path>>(
&mut self,
path: P,
) -> Result<(), SchemaError>
pub fn load_schema_from_file<P: AsRef<Path>>( &mut self, path: P, ) -> Result<(), SchemaError>
Load schema from file (creates Available schema)
Sourcepub fn get_db_ops(&self) -> Arc<DbOperations>
pub fn get_db_ops(&self) -> Arc<DbOperations>
Provides access to the underlying database operations
Sourcepub fn get_event_statistics(&self) -> EventStatistics
pub fn get_event_statistics(&self) -> EventStatistics
Get current event statistics from the event monitor
Sourcepub fn get_backfill_tracker(&self) -> Arc<BackfillTracker>
pub fn get_backfill_tracker(&self) -> Arc<BackfillTracker>
Get the backfill tracker
Sourcepub fn get_all_backfills(&self) -> Vec<BackfillInfo>
pub fn get_all_backfills(&self) -> Vec<BackfillInfo>
Get all backfill information
Sourcepub fn get_active_backfills(&self) -> Vec<BackfillInfo>
pub fn get_active_backfills(&self) -> Vec<BackfillInfo>
Get active (in-progress) backfills
Sourcepub fn get_backfill(&self, transform_id: &str) -> Option<BackfillInfo>
pub fn get_backfill(&self, transform_id: &str) -> Option<BackfillInfo>
Get specific backfill info
Sourcepub fn message_bus(&self) -> Arc<MessageBus>
pub fn message_bus(&self) -> Arc<MessageBus>
Get the message bus for publishing events (for testing)
Sourcepub fn transform_manager(&self) -> Arc<TransformManager>
pub fn transform_manager(&self) -> Arc<TransformManager>
Get the transform manager for testing transform functionality
Sourcepub fn schema_manager(&self) -> Arc<SchemaCore>
pub fn schema_manager(&self) -> Arc<SchemaCore>
Get the schema manager for testing schema functionality
Sourcepub fn native_word_search(
&self,
term: &str,
) -> Result<Vec<IndexResult>, SchemaError>
pub fn native_word_search( &self, term: &str, ) -> Result<Vec<IndexResult>, SchemaError>
Search the native word index for a specific term
Sourcepub fn native_search_all_classifications(
&self,
term: &str,
) -> Result<Vec<IndexResult>, SchemaError>
pub fn native_search_all_classifications( &self, term: &str, ) -> Result<Vec<IndexResult>, SchemaError>
Search native index across all classification types and aggregate results This now includes field name matches via search_word
Sourcepub fn transform_orchestrator(&self) -> Arc<TransformOrchestrator>
pub fn transform_orchestrator(&self) -> Arc<TransformOrchestrator>
Get the transform orchestrator for managing transform execution
Auto Trait Implementations§
impl Freeze for FoldDB
impl !RefUnwindSafe for FoldDB
impl Send for FoldDB
impl Sync for FoldDB
impl Unpin for FoldDB
impl !UnwindSafe for FoldDB
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more