Skip to main content

ScriptExecutor

Trait ScriptExecutor 

Source
pub trait ScriptExecutor: Sealed {
    // Required method
    fn execute_script<'a>(
        &'a self,
        sql: &'a str,
    ) -> impl Future<Output = Result<u64, Error>> + Send + 'a;
}
Expand description

Runs multi-statement SQL scripts via the simple query protocol.

This is the unchecked, parameterless path (for migrations, SET scripts and statements the extended protocol cannot express, such as VACUUM). Use query! / query_as! for anything parameterized or typed.

Required Methods§

Source

fn execute_script<'a>( &'a self, sql: &'a str, ) -> impl Future<Output = Result<u64, Error>> + Send + 'a

Runs one or more statements and returns the affected-row count of the last command.

§Errors

Returns an error if the connection is closed or the server rejects a statement.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§