Trait SqlExecutorAsync

Source
pub trait SqlExecutorAsync: Send {
    type Error: Error + Send;

    // Required methods
    fn sql_query_values(
        &mut self,
        query: &str,
    ) -> impl Future<Output = Result<Vec<u32>, Self::Error>> + Send;
    fn sql_execute(
        &mut self,
        query: &str,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send;
}
Expand description

Defines an implementation capable of executing SQL statement on a sqlite connection.

This is required so we can set up the temporary triggers and tables required to track changes.

Required Associated Types§

Required Methods§

Source

fn sql_query_values( &mut self, query: &str, ) -> impl Future<Output = Result<Vec<u32>, Self::Error>> + Send

This method will execute a query which returns 0 or N rows with one column of type u32.

§Errors

Should return error if the query failed.

Source

fn sql_execute( &mut self, query: &str, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Execute an sql statement which does not return any rows.

§Errors

Should return error if the query failed.

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§