Skip to main content

DatabaseAutoCreation

Trait DatabaseAutoCreation 

Source
pub trait DatabaseAutoCreation:
    Clone
    + Send
    + Sync
    + 'static {
    type InstanceConfig;

    // Required methods
    fn new(instance: Self::InstanceConfig) -> Self;
    fn with_schema(
        instance: Self::InstanceConfig,
        schema: DatabaseSchema,
    ) -> Self
       where Self: Sized;
    fn create_database_if_not_exists(
        &self,
    ) -> impl Future<Output = Result<bool, AutoCreationError>> + Send;
    fn create_tables_if_not_exist(
        &self,
    ) -> impl Future<Output = Result<Vec<String>, AutoCreationError>> + Send;
    fn verify_connection(
        &self,
    ) -> impl Future<Output = Result<(), AutoCreationError>> + Send;
}

Required Associated Types§

Required Methods§

Source

fn new(instance: Self::InstanceConfig) -> Self

Source

fn with_schema(instance: Self::InstanceConfig, schema: DatabaseSchema) -> Self
where Self: Sized,

Source

fn create_database_if_not_exists( &self, ) -> impl Future<Output = Result<bool, AutoCreationError>> + Send

Source

fn create_tables_if_not_exist( &self, ) -> impl Future<Output = Result<Vec<String>, AutoCreationError>> + Send

Source

fn verify_connection( &self, ) -> impl Future<Output = Result<(), AutoCreationError>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§