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§
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".