Trait svc_storage::postgres::init::PsqlInitResource
source · pub trait PsqlInitResource{
// Required method
fn _get_create_table_query() -> String;
// Provided methods
fn _init_table_indices<'async_trait>(
) -> Pin<Box<dyn Future<Output = Result<(), ArrErr>> + Send + 'async_trait>>
where Self: Send + 'async_trait { ... }
fn init_table<'async_trait>(
) -> Pin<Box<dyn Future<Output = Result<(), ArrErr>> + Send + 'async_trait>>
where Self: Send + 'async_trait { ... }
fn drop_table<'async_trait>(
) -> Pin<Box<dyn Future<Output = Result<(), ArrErr>> + Send + 'async_trait>>
where Self: Send + 'async_trait { ... }
}
Expand description
Generic PostgreSQL trait to provide table init functions for Resource
struct
Required Methods§
sourcefn _get_create_table_query() -> String
fn _get_create_table_query() -> String
Internal function to get the query that should be used to create the resource’s table. Should be overwritten by the implementor.
Provided Methods§
sourcefn _init_table_indices<'async_trait>(
) -> Pin<Box<dyn Future<Output = Result<(), ArrErr>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
fn _init_table_indices<'async_trait>(
) -> Pin<Box<dyn Future<Output = Result<(), ArrErr>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
Internal function called by init_table to run table index creation queries if any indices are defined for the resource
Object Safety§
This trait is not object safe.