pub trait DatabaseObserver: Send + Sync {
// Provided methods
fn on_collection_created(&self, _name: &str, _kind: &CollectionType) { ... }
fn on_collection_deleted(&self, _name: &str) { ... }
fn on_upsert(&self, _collection: &str, _point_count: usize) { ... }
fn on_query(&self, _collection: &str, _duration_us: u64) { ... }
}Expand description
Lifecycle hooks for database events.
Implement this trait in velesdb-premium to attach RBAC, audit logging,
multi-tenant routing, or replication logic without modifying the core.
§Example (Premium side)
ⓘ
use velesdb_core::{DatabaseObserver, CollectionType};
struct PremiumObserver { /* audit_log, rbac, tenant_router */ }
impl DatabaseObserver for PremiumObserver {
fn on_collection_created(&self, name: &str, kind: &CollectionType) {
// self.audit_log.record(...)
}
}Provided Methods§
Sourcefn on_collection_created(&self, _name: &str, _kind: &CollectionType)
fn on_collection_created(&self, _name: &str, _kind: &CollectionType)
Called after a collection is successfully created.
Sourcefn on_collection_deleted(&self, _name: &str)
fn on_collection_deleted(&self, _name: &str)
Called after a collection is successfully deleted.