Skip to main content

DeleteDb

Trait DeleteDb 

Source
pub trait DeleteDb: Send + Sync {
Show 28 methods // Required methods fn get_data<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<Data>, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn delete_data<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn count_data_dataset_links<'life0, 'async_trait>( &'life0 self, data_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<usize, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn list_datasets_for_data<'life0, 'async_trait>( &'life0 self, data_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Dataset>, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn get_dataset_by_name<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, owner_id: Uuid, tenant_id: Option<Uuid>, ) -> Pin<Box<dyn Future<Output = Result<Option<Dataset>, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn get_dataset_data<'life0, 'async_trait>( &'life0 self, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Data>, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn count_dataset_data<'life0, 'async_trait>( &'life0 self, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<usize, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn list_datasets_by_owner<'life0, 'async_trait>( &'life0 self, owner_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Dataset>, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn list_datasets<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Dataset>, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn delete_dataset<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn detach_data_from_dataset<'life0, 'async_trait>( &'life0 self, dataset_id: Uuid, data_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn delete_pipeline_runs_by_dataset<'life0, 'async_trait>( &'life0 self, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<u64, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn clear_pipeline_status_for_dataset<'life0, 'async_trait>( &'life0 self, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<usize, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn clear_cognify_pipeline_status_for_data<'life0, 'async_trait>( &'life0 self, data_id: Uuid, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn get_nodes_by_dataset<'life0, 'async_trait>( &'life0 self, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<GraphNode>, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn get_edges_by_dataset<'life0, 'async_trait>( &'life0 self, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<GraphEdge>, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn get_unique_nodes_for_data<'life0, 'async_trait>( &'life0 self, data_id: Uuid, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<GraphNode>, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn get_unique_edges_for_data<'life0, 'async_trait>( &'life0 self, data_id: Uuid, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<GraphEdge>, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn delete_provenance_nodes_for_dataset<'life0, 'async_trait>( &'life0 self, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn delete_provenance_edges_for_dataset<'life0, 'async_trait>( &'life0 self, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn delete_provenance_nodes_for_data<'life0, 'async_trait>( &'life0 self, data_id: Uuid, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn delete_provenance_edges_for_data<'life0, 'async_trait>( &'life0 self, data_id: Uuid, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn get_provenance_node_count_for_data<'life0, 'async_trait>( &'life0 self, data_id: Uuid, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<usize, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn get_provenance_edge_count_for_data<'life0, 'async_trait>( &'life0 self, data_id: Uuid, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<usize, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn delete_search_history_for_user<'life0, 'async_trait>( &'life0 self, user_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<u64, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn delete_all_search_history<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn count_search_history_for_user<'life0, 'async_trait>( &'life0 self, user_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<u64, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn count_all_search_history<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64, DatabaseError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait;
}

Required Methods§

Source

fn get_data<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<Data>, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn delete_data<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn list_datasets_for_data<'life0, 'async_trait>( &'life0 self, data_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Dataset>, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn get_dataset_by_name<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, owner_id: Uuid, tenant_id: Option<Uuid>, ) -> Pin<Box<dyn Future<Output = Result<Option<Dataset>, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn get_dataset_data<'life0, 'async_trait>( &'life0 self, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Data>, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn count_dataset_data<'life0, 'async_trait>( &'life0 self, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<usize, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Count the number of data items linked to a dataset without loading them.

Source

fn list_datasets_by_owner<'life0, 'async_trait>( &'life0 self, owner_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Dataset>, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn list_datasets<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Dataset>, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn delete_dataset<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn detach_data_from_dataset<'life0, 'async_trait>( &'life0 self, dataset_id: Uuid, data_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn delete_pipeline_runs_by_dataset<'life0, 'async_trait>( &'life0 self, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<u64, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Delete all pipeline_runs rows for a given dataset.

Needed for data-scoped deletion where the dataset itself is not deleted (FK cascade does not fire) but the pipeline cache should be invalidated.

Source

fn clear_pipeline_status_for_dataset<'life0, 'async_trait>( &'life0 self, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<usize, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Clear pipeline_status JSON entries keyed by dataset_id from all Data records linked to that dataset.

Must be called while junction rows still exist.

Source

fn clear_cognify_pipeline_status_for_data<'life0, 'async_trait>( &'life0 self, data_id: Uuid, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Clear only the cognify_pipeline key from the pipeline_status JSON of a single Data record, removing only the entry keyed by dataset_id.

Source

fn get_nodes_by_dataset<'life0, 'async_trait>( &'life0 self, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<GraphNode>, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Get all provenance node rows for a dataset.

Source

fn get_edges_by_dataset<'life0, 'async_trait>( &'life0 self, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<GraphEdge>, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Get all provenance edge rows for a dataset.

Source

fn get_unique_nodes_for_data<'life0, 'async_trait>( &'life0 self, data_id: Uuid, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<GraphNode>, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Get nodes belonging to (data_id, dataset_id) whose slug is NOT shared with other data items in the same dataset. Safe for targeted deletion.

Source

fn get_unique_edges_for_data<'life0, 'async_trait>( &'life0 self, data_id: Uuid, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<GraphEdge>, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Get edges belonging to (data_id, dataset_id) whose slug is NOT shared with other data items in the same dataset.

Source

fn delete_provenance_nodes_for_dataset<'life0, 'async_trait>( &'life0 self, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Delete all provenance node rows for a dataset.

Source

fn delete_provenance_edges_for_dataset<'life0, 'async_trait>( &'life0 self, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Delete all provenance edge rows for a dataset.

Source

fn delete_provenance_nodes_for_data<'life0, 'async_trait>( &'life0 self, data_id: Uuid, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Delete provenance node rows for a specific (data_id, dataset_id) pair.

Source

fn delete_provenance_edges_for_data<'life0, 'async_trait>( &'life0 self, data_id: Uuid, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Delete provenance edge rows for a specific (data_id, dataset_id) pair.

Source

fn get_provenance_node_count_for_data<'life0, 'async_trait>( &'life0 self, data_id: Uuid, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<usize, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Count provenance node rows for a specific (data_id, dataset_id) pair.

Source

fn get_provenance_edge_count_for_data<'life0, 'async_trait>( &'life0 self, data_id: Uuid, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<usize, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Count provenance edge rows for a specific (data_id, dataset_id) pair.

Source

fn delete_search_history_for_user<'life0, 'async_trait>( &'life0 self, user_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<u64, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Delete all search history (queries + cascaded results) for a user.

Returns the number of deleted query rows.

Source

fn delete_all_search_history<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Delete all search history (queries + cascaded results).

Returns the number of deleted query rows.

Source

fn count_search_history_for_user<'life0, 'async_trait>( &'life0 self, user_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<u64, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Count search history query rows for a specific user.

Source

fn count_all_search_history<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Count all search history query rows.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§