pub struct AdminService { /* private fields */ }Expand description
Service providing administrative operations (integrity checks, exports, restores, purges).
Implementations§
Source§impl AdminService
impl AdminService
Sourcepub fn new(path: impl AsRef<Path>, schema_manager: Arc<SchemaManager>) -> Self
pub fn new(path: impl AsRef<Path>, schema_manager: Arc<SchemaManager>) -> Self
Create a new admin service for the database at the given path.
Sourcepub fn check_integrity(&self) -> Result<IntegrityReport, EngineError>
pub fn check_integrity(&self) -> Result<IntegrityReport, EngineError>
§Errors
Returns EngineError if the database connection fails or any SQL query fails.
Sourcepub fn check_semantics(&self) -> Result<SemanticReport, EngineError>
pub fn check_semantics(&self) -> Result<SemanticReport, EngineError>
§Errors
Returns EngineError if the database connection fails or any SQL query fails.
Sourcepub fn register_operational_collection(
&self,
request: &OperationalRegisterRequest,
) -> Result<OperationalCollectionRecord, EngineError>
pub fn register_operational_collection( &self, request: &OperationalRegisterRequest, ) -> Result<OperationalCollectionRecord, EngineError>
§Errors
Returns EngineError if the collection metadata is invalid or the insert fails.
Sourcepub fn describe_operational_collection(
&self,
name: &str,
) -> Result<Option<OperationalCollectionRecord>, EngineError>
pub fn describe_operational_collection( &self, name: &str, ) -> Result<Option<OperationalCollectionRecord>, EngineError>
§Errors
Returns EngineError if the database query fails.
Sourcepub fn update_operational_collection_filters(
&self,
name: &str,
filter_fields_json: &str,
) -> Result<OperationalCollectionRecord, EngineError>
pub fn update_operational_collection_filters( &self, name: &str, filter_fields_json: &str, ) -> Result<OperationalCollectionRecord, EngineError>
§Errors
Returns EngineError if the collection is missing, the filter contract is invalid,
or existing mutation backfill fails.
Sourcepub fn update_operational_collection_validation(
&self,
name: &str,
validation_json: &str,
) -> Result<OperationalCollectionRecord, EngineError>
pub fn update_operational_collection_validation( &self, name: &str, validation_json: &str, ) -> Result<OperationalCollectionRecord, EngineError>
§Errors
Returns EngineError if the collection is missing or the validation contract is invalid.
Sourcepub fn update_operational_collection_secondary_indexes(
&self,
name: &str,
secondary_indexes_json: &str,
) -> Result<OperationalCollectionRecord, EngineError>
pub fn update_operational_collection_secondary_indexes( &self, name: &str, secondary_indexes_json: &str, ) -> Result<OperationalCollectionRecord, EngineError>
§Errors
Returns EngineError if the collection is missing, the contract is invalid,
or derived index rebuild fails.
Sourcepub fn rebuild_operational_secondary_indexes(
&self,
name: &str,
) -> Result<OperationalSecondaryIndexRebuildReport, EngineError>
pub fn rebuild_operational_secondary_indexes( &self, name: &str, ) -> Result<OperationalSecondaryIndexRebuildReport, EngineError>
§Errors
Returns EngineError if the collection is missing or rebuild fails.
Sourcepub fn validate_operational_collection_history(
&self,
name: &str,
) -> Result<OperationalHistoryValidationReport, EngineError>
pub fn validate_operational_collection_history( &self, name: &str, ) -> Result<OperationalHistoryValidationReport, EngineError>
§Errors
Returns EngineError if the collection is missing or its validation contract is invalid.
Sourcepub fn disable_operational_collection(
&self,
name: &str,
) -> Result<OperationalCollectionRecord, EngineError>
pub fn disable_operational_collection( &self, name: &str, ) -> Result<OperationalCollectionRecord, EngineError>
§Errors
Returns EngineError if the database query fails.
Sourcepub fn compact_operational_collection(
&self,
name: &str,
dry_run: bool,
) -> Result<OperationalCompactionReport, EngineError>
pub fn compact_operational_collection( &self, name: &str, dry_run: bool, ) -> Result<OperationalCompactionReport, EngineError>
§Errors
Returns EngineError if the database query fails.
Sourcepub fn purge_operational_collection(
&self,
name: &str,
before_timestamp: i64,
) -> Result<OperationalPurgeReport, EngineError>
pub fn purge_operational_collection( &self, name: &str, before_timestamp: i64, ) -> Result<OperationalPurgeReport, EngineError>
§Errors
Returns EngineError if the database query fails.
Sourcepub fn plan_operational_retention(
&self,
now_timestamp: i64,
collection_names: Option<&[String]>,
max_collections: Option<usize>,
) -> Result<OperationalRetentionPlanReport, EngineError>
pub fn plan_operational_retention( &self, now_timestamp: i64, collection_names: Option<&[String]>, max_collections: Option<usize>, ) -> Result<OperationalRetentionPlanReport, EngineError>
§Errors
Returns EngineError if collection selection or policy parsing fails.
Sourcepub fn run_operational_retention(
&self,
now_timestamp: i64,
collection_names: Option<&[String]>,
max_collections: Option<usize>,
dry_run: bool,
) -> Result<OperationalRetentionRunReport, EngineError>
pub fn run_operational_retention( &self, now_timestamp: i64, collection_names: Option<&[String]>, max_collections: Option<usize>, dry_run: bool, ) -> Result<OperationalRetentionRunReport, EngineError>
§Errors
Returns EngineError if collection selection, policy parsing, or execution fails.
Sourcepub fn trace_operational_collection(
&self,
collection_name: &str,
record_key: Option<&str>,
) -> Result<OperationalTraceReport, EngineError>
pub fn trace_operational_collection( &self, collection_name: &str, record_key: Option<&str>, ) -> Result<OperationalTraceReport, EngineError>
§Errors
Returns EngineError if the database query fails.
Sourcepub fn read_operational_collection(
&self,
request: &OperationalReadRequest,
) -> Result<OperationalReadReport, EngineError>
pub fn read_operational_collection( &self, request: &OperationalReadRequest, ) -> Result<OperationalReadReport, EngineError>
§Errors
Returns EngineError if the collection contract is invalid or the filtered read fails.
Sourcepub fn rebuild_operational_current(
&self,
collection_name: Option<&str>,
) -> Result<OperationalRepairReport, EngineError>
pub fn rebuild_operational_current( &self, collection_name: Option<&str>, ) -> Result<OperationalRepairReport, EngineError>
§Errors
Returns EngineError if the database query fails or collection validation fails.
Sourcepub fn rebuild_projections(
&self,
target: ProjectionTarget,
) -> Result<ProjectionRepairReport, EngineError>
pub fn rebuild_projections( &self, target: ProjectionTarget, ) -> Result<ProjectionRepairReport, EngineError>
§Errors
Returns EngineError if the database connection fails or the projection rebuild fails.
Sourcepub fn rebuild_missing_projections(
&self,
) -> Result<ProjectionRepairReport, EngineError>
pub fn rebuild_missing_projections( &self, ) -> Result<ProjectionRepairReport, EngineError>
§Errors
Returns EngineError if the database connection fails or the projection rebuild fails.
Sourcepub fn register_fts_property_schema(
&self,
kind: &str,
property_paths: &[String],
separator: Option<&str>,
) -> Result<FtsPropertySchemaRecord, EngineError>
pub fn register_fts_property_schema( &self, kind: &str, property_paths: &[String], separator: Option<&str>, ) -> Result<FtsPropertySchemaRecord, EngineError>
Register (or update) an FTS property projection schema for the given node kind.
After registration, any node of this kind will have the declared JSON property
paths extracted, concatenated, and indexed in the fts_node_properties FTS5 table.
§Errors
Returns EngineError if property_paths is empty, contains duplicates,
or if the database write fails.
Sourcepub fn describe_fts_property_schema(
&self,
kind: &str,
) -> Result<Option<FtsPropertySchemaRecord>, EngineError>
pub fn describe_fts_property_schema( &self, kind: &str, ) -> Result<Option<FtsPropertySchemaRecord>, EngineError>
Return the FTS property schema for a single node kind, if registered.
§Errors
Returns EngineError if the database query fails.
Sourcepub fn list_fts_property_schemas(
&self,
) -> Result<Vec<FtsPropertySchemaRecord>, EngineError>
pub fn list_fts_property_schemas( &self, ) -> Result<Vec<FtsPropertySchemaRecord>, EngineError>
Return all registered FTS property schemas.
§Errors
Returns EngineError if the database query fails.
Sourcepub fn remove_fts_property_schema(&self, kind: &str) -> Result<(), EngineError>
pub fn remove_fts_property_schema(&self, kind: &str) -> Result<(), EngineError>
Remove the FTS property schema for a node kind.
This does not delete existing fts_node_properties rows for this kind;
call rebuild_projections(Fts) to clean up stale rows.
§Errors
Returns EngineError if the kind is not registered or the delete fails.
Sourcepub fn restore_vector_profiles(
&self,
) -> Result<ProjectionRepairReport, EngineError>
pub fn restore_vector_profiles( &self, ) -> Result<ProjectionRepairReport, EngineError>
Recreate enabled vector profiles from persisted vector_profiles metadata.
§Errors
Returns EngineError if the database connection fails, reading metadata fails,
or sqlite-vec support is unavailable while enabled profiles are present.
Sourcepub fn regenerate_vector_embeddings(
&self,
config: &VectorRegenerationConfig,
) -> Result<VectorRegenerationReport, EngineError>
pub fn regenerate_vector_embeddings( &self, config: &VectorRegenerationConfig, ) -> Result<VectorRegenerationReport, EngineError>
Rebuild vector embeddings using an application-supplied regeneration contract and generator command.
The config is persisted in vector_embedding_contracts so the metadata
required for recovery survives future repair runs.
§Errors
Returns EngineError if the database connection fails, the config is
invalid, the generator command fails, or the regenerated embeddings are
malformed.
Sourcepub fn regenerate_vector_embeddings_with_policy(
&self,
config: &VectorRegenerationConfig,
policy: &VectorGeneratorPolicy,
) -> Result<VectorRegenerationReport, EngineError>
pub fn regenerate_vector_embeddings_with_policy( &self, config: &VectorRegenerationConfig, policy: &VectorGeneratorPolicy, ) -> Result<VectorRegenerationReport, EngineError>
§Errors
Returns EngineError if the database connection fails, the config is
invalid, the generator command fails, or the regenerated embeddings are
malformed.
Sourcepub fn trace_source(&self, source_ref: &str) -> Result<TraceReport, EngineError>
pub fn trace_source(&self, source_ref: &str) -> Result<TraceReport, EngineError>
§Errors
Returns EngineError if the database connection fails or any SQL query fails.
Sourcepub fn restore_logical_id(
&self,
logical_id: &str,
) -> Result<LogicalRestoreReport, EngineError>
pub fn restore_logical_id( &self, logical_id: &str, ) -> Result<LogicalRestoreReport, EngineError>
§Errors
Returns EngineError if the database connection fails, the transaction cannot be
started, or lifecycle restoration prerequisites are missing.
Sourcepub fn purge_logical_id(
&self,
logical_id: &str,
) -> Result<LogicalPurgeReport, EngineError>
pub fn purge_logical_id( &self, logical_id: &str, ) -> Result<LogicalPurgeReport, EngineError>
§Errors
Returns EngineError if the database connection fails, the transaction cannot be
started, or the purge mutation fails.
Sourcepub fn purge_provenance_events(
&self,
before_timestamp: i64,
options: &ProvenancePurgeOptions,
) -> Result<ProvenancePurgeReport, EngineError>
pub fn purge_provenance_events( &self, before_timestamp: i64, options: &ProvenancePurgeOptions, ) -> Result<ProvenancePurgeReport, EngineError>
Purge provenance events older than before_timestamp.
By default, excise and purge_logical_id event types are preserved so that
data-deletion audit trails survive. Pass an explicit
preserve_event_types list to override this default.
§Errors
Returns EngineError if the database connection fails, the transaction
cannot be started, or any SQL statement fails.
Sourcepub fn excise_source(
&self,
source_ref: &str,
) -> Result<TraceReport, EngineError>
pub fn excise_source( &self, source_ref: &str, ) -> Result<TraceReport, EngineError>
§Errors
Returns EngineError if the database connection fails, the transaction cannot be
started, or any SQL statement fails.
Sourcepub fn safe_export(
&self,
destination_path: impl AsRef<Path>,
options: SafeExportOptions,
) -> Result<SafeExportManifest, EngineError>
pub fn safe_export( &self, destination_path: impl AsRef<Path>, options: SafeExportOptions, ) -> Result<SafeExportManifest, EngineError>
§Errors
Returns EngineError if the WAL checkpoint fails, the SQLite backup fails,
the SHA-256 digest cannot be computed, or the manifest file cannot be written.