Skip to main content

RelationalStorage

Trait RelationalStorage 

Source
pub trait RelationalStorage: Storage {
    // Required methods
    fn execute_sql<'life0, 'life1, 'async_trait>(
        &'life0 self,
        sql: &'life1 str,
        params: Vec<SqlParam>,
    ) -> Pin<Box<dyn Future<Output = StorageResult<SqlResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn query_sql<'life0, 'life1, 'async_trait, T>(
        &'life0 self,
        sql: &'life1 str,
        params: Vec<SqlParam>,
    ) -> Pin<Box<dyn Future<Output = StorageResult<Vec<T>>> + Send + 'async_trait>>
       where Self: Sized + 'async_trait,
             T: 'async_trait + DeserializeOwned + Send + Sync,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn create_index<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        table: &'life1 str,
        index_name: &'life2 str,
        columns: Vec<String>,
        unique: bool,
    ) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn drop_index<'life0, 'life1, 'async_trait>(
        &'life0 self,
        index_name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn vacuum<'life0, 'life1, 'async_trait>(
        &'life0 self,
        table: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn analyze<'life0, 'life1, 'async_trait>(
        &'life0 self,
        table: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Relational database operations (for PostgreSQL)

Required Methods§

Source

fn execute_sql<'life0, 'life1, 'async_trait>( &'life0 self, sql: &'life1 str, params: Vec<SqlParam>, ) -> Pin<Box<dyn Future<Output = StorageResult<SqlResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute raw SQL query

Source

fn query_sql<'life0, 'life1, 'async_trait, T>( &'life0 self, sql: &'life1 str, params: Vec<SqlParam>, ) -> Pin<Box<dyn Future<Output = StorageResult<Vec<T>>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, T: 'async_trait + DeserializeOwned + Send + Sync, 'life0: 'async_trait, 'life1: 'async_trait,

Execute SQL query and return results

Source

fn create_index<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, table: &'life1 str, index_name: &'life2 str, columns: Vec<String>, unique: bool, ) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Create index

Source

fn drop_index<'life0, 'life1, 'async_trait>( &'life0 self, index_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Drop index

Source

fn vacuum<'life0, 'life1, 'async_trait>( &'life0 self, table: &'life1 str, ) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Vacuum table (optimize storage)

Source

fn analyze<'life0, 'life1, 'async_trait>( &'life0 self, table: &'life1 str, ) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Analyze table (update statistics)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§