pub trait ProxyDatabaseTrait: Send + Sync + Debug {
    // Required methods
    fn query(&self, statement: Statement) -> Result<Vec<ProxyRow>, DbErr>;
    fn execute(&self, statement: Statement) -> Result<ProxyExecResult, DbErr>;

    // Provided methods
    fn begin(&self) { ... }
    fn commit(&self) { ... }
    fn rollback(&self) { ... }
    fn ping(&self) -> Result<(), DbErr> { ... }
}
Available on crate feature proxy only.
Expand description

Defines the ProxyDatabaseTrait to save the functions

Required Methods§

source

fn query(&self, statement: Statement) -> Result<Vec<ProxyRow>, DbErr>

Execute a query in the [ProxyDatabase], and return the query results

source

fn execute(&self, statement: Statement) -> Result<ProxyExecResult, DbErr>

Execute a command in the [ProxyDatabase], and report the number of rows affected

Provided Methods§

source

fn begin(&self)

Begin a transaction in the [ProxyDatabase]

source

fn commit(&self)

Commit a transaction in the [ProxyDatabase]

source

fn rollback(&self)

Rollback a transaction in the [ProxyDatabase]

source

fn ping(&self) -> Result<(), DbErr>

Ping the [ProxyDatabase], it should return an error if the database is not available

Implementors§