Skip to main content

IngestDb

Trait IngestDb 

Source
pub trait IngestDb: Send + Sync {
    // Required methods
    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<'life0, 'async_trait>(
        &'life0 self,
        id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Dataset>, DatabaseError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn create_dataset<'life0, 'async_trait>(
        &'life0 self,
        dataset: Dataset,
    ) -> Pin<Box<dyn Future<Output = Result<Dataset, 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 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 create_data<'life0, 'async_trait>(
        &'life0 self,
        d: Data,
    ) -> Pin<Box<dyn Future<Output = Result<Data, DatabaseError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn attach_data_to_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 update_last_accessed<'life0, 'life1, 'async_trait>(
        &'life0 self,
        data_ids: &'life1 [Uuid],
        timestamp: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn get_latest_pipeline_status<'life0, 'life1, 'async_trait>(
        &'life0 self,
        pipeline_name: &'life1 str,
        dataset_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Option<PipelineRunStatus>, DatabaseError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
}

Required Methods§

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<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<Dataset>, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Look up a dataset by its UUID.

Source

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

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,

List all datasets owned by the given user.

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 create_data<'life0, 'async_trait>( &'life0 self, d: Data, ) -> Pin<Box<dyn Future<Output = Result<Data, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn attach_data_to_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 update_last_accessed<'life0, 'life1, 'async_trait>( &'life0 self, data_ids: &'life1 [Uuid], timestamp: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Update the last_accessed timestamp on the given Data records.

Implementations should perform a bulk UPDATE data SET last_accessed = ? WHERE id IN (...) query. An empty data_ids slice is a no-op.

Source

fn get_latest_pipeline_status<'life0, 'life1, 'async_trait>( &'life0 self, pipeline_name: &'life1 str, dataset_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<PipelineRunStatus>, DatabaseError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get the latest pipeline run status for a (pipeline_name, dataset_id) pair.

Returns None if no matching run exists.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§