taitan_orm

Trait SqlExecutorMut

Source
pub trait SqlExecutorMut: SqlGenericExecutor {
Show 20 methods // Required methods async fn execute<'a>( &'a mut self, stmt: &'a str, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<u64>; async fn execute_plain<'a>(&'a mut self, stmt: &'a str) -> Result<u64>; async fn fetch_exists<'a>( &'a mut self, stmt: &'a str, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<bool>; async fn fetch_exists_plain<'a, A>( &'a mut self, stmt: &'a str, ) -> Result<bool>; async fn fetch_count<'s, 'a>( &'a mut self, stmt: &'s str, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<u64> where 'a: 's; async fn fetch_count_plain<'a>(&'a mut self, stmt: &'a str) -> Result<u64>; async fn fetch_option<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE::Selection, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<Option<SE>> where SE: SelectedEntity<Self::DB> + Send + Unpin; async fn fetch_option_<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<Option<SE>> where SE: SelectedEntity<Self::DB> + Send + Unpin; async fn fetch_option_plain<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE::Selection, ) -> Result<Option<SE>> where SE: SelectedEntity<Self::DB> + Send + Unpin; async fn fetch_option_plain_<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE, ) -> Result<Option<SE>> where SE: SelectedEntity<Self::DB> + Send + Unpin; async fn fetch_all<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE::Selection, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<Vec<SE>> where SE: SelectedEntity<Self::DB> + Send + Unpin; async fn fetch_all_<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<Vec<SE>> where SE: SelectedEntity<Self::DB> + Send + Unpin; async fn fetch_all_plain<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE::Selection, ) -> Result<Vec<SE>> where SE: SelectedEntity<Self::DB> + Send + Unpin; async fn fetch_all_plain_<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE, ) -> Result<Vec<SE>> where SE: SelectedEntity<Self::DB> + Send + Unpin; async fn fetch_one_full<'a, SE>( &'a mut self, stmt: &'a str, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<SE> where SE: SelectedEntity<Self::DB> + Send + Unpin; async fn fetch_one_full_plain<'a, SE>( &'a mut self, stmt: &'a str, ) -> Result<SE> where SE: SelectedEntity<Self::DB> + Send + Unpin; async fn fetch_option_full<'a, SE>( &'a mut self, stmt: &'a str, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<Option<SE>> where SE: SelectedEntity<Self::DB> + Send + Unpin; async fn fetch_option_full_plain<'a, SE>( &'a mut self, stmt: &'a str, ) -> Result<Option<SE>> where SE: SelectedEntity<Self::DB> + Send + Unpin; async fn fetch_all_full<'a, SE>( &'a mut self, stmt: &'a str, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<Vec<SE>> where SE: SelectedEntity<Self::DB> + Send + Unpin; async fn fetch_all_full_plain<'a, SE>( &'a mut self, stmt: &'a str, ) -> Result<Vec<SE>> where SE: SelectedEntity<Self::DB> + Send + Unpin;
}
Expand description

现在sqlx::Executor的实现还是太过简陋,导致无法把不同数据库和事务的连接抽象成一个独立的实体 屏蔽掉ex,让更上层的API层不再感知connection/transaction, 这层抽象让上层实现API接口的实现可以把普通操作和事务操作合并为一份

本模块提供以下接口方法 execute (stmt, args) -> Result execute_plain (stmt ) -> Result

fetch_exists (stmt, args) -> Result fetch_exists_plain (stmt, ) -> Result

fetch_option (stmt, selection, args) -> Result<Option> fetch_option_plain(stmt, selection, ) -> Result<Option> – fetch_one (stmt, selection, args) -> Result – fetch_one_plain (stmt, selection, ) -> Result fetch_all (stmt, selection, args) -> Result<Vec> fetch_all_plain (stmt, selection, ) -> Result<Vec>

fetch_all_full (stmt, args) -> Result<Vec> fetch_all_full_plain (stmt, ) -> Result<Vec> fetch_one_full (stmt, args) -> Result fetch_one_full_plain (stmt, ) -> Result fetch_option_full (stmt, args) -> Result<Option> fetch_option_full_plain(stmt, ) -> Result<Option>

Required Methods§

Source

async fn execute<'a>( &'a mut self, stmt: &'a str, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<u64>

Source

async fn execute_plain<'a>(&'a mut self, stmt: &'a str) -> Result<u64>

Source

async fn fetch_exists<'a>( &'a mut self, stmt: &'a str, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<bool>

Source

async fn fetch_exists_plain<'a, A>(&'a mut self, stmt: &'a str) -> Result<bool>

Source

async fn fetch_count<'s, 'a>( &'a mut self, stmt: &'s str, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<u64>
where 'a: 's,

Source

async fn fetch_count_plain<'a>(&'a mut self, stmt: &'a str) -> Result<u64>

Source

async fn fetch_option<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE::Selection, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<Option<SE>>
where SE: SelectedEntity<Self::DB> + Send + Unpin,

Source

async fn fetch_option_<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<Option<SE>>
where SE: SelectedEntity<Self::DB> + Send + Unpin,

Source

async fn fetch_option_plain<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE::Selection, ) -> Result<Option<SE>>
where SE: SelectedEntity<Self::DB> + Send + Unpin,

Source

async fn fetch_option_plain_<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE, ) -> Result<Option<SE>>
where SE: SelectedEntity<Self::DB> + Send + Unpin,

Source

async fn fetch_all<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE::Selection, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<Vec<SE>>
where SE: SelectedEntity<Self::DB> + Send + Unpin,

Source

async fn fetch_all_<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<Vec<SE>>
where SE: SelectedEntity<Self::DB> + Send + Unpin,

Source

async fn fetch_all_plain<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE::Selection, ) -> Result<Vec<SE>>
where SE: SelectedEntity<Self::DB> + Send + Unpin,

Source

async fn fetch_all_plain_<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE, ) -> Result<Vec<SE>>
where SE: SelectedEntity<Self::DB> + Send + Unpin,

Source

async fn fetch_one_full<'a, SE>( &'a mut self, stmt: &'a str, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<SE>
where SE: SelectedEntity<Self::DB> + Send + Unpin,

Source

async fn fetch_one_full_plain<'a, SE>(&'a mut self, stmt: &'a str) -> Result<SE>
where SE: SelectedEntity<Self::DB> + Send + Unpin,

Source

async fn fetch_option_full<'a, SE>( &'a mut self, stmt: &'a str, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<Option<SE>>
where SE: SelectedEntity<Self::DB> + Send + Unpin,

Source

async fn fetch_option_full_plain<'a, SE>( &'a mut self, stmt: &'a str, ) -> Result<Option<SE>>
where SE: SelectedEntity<Self::DB> + Send + Unpin,

Source

async fn fetch_all_full<'a, SE>( &'a mut self, stmt: &'a str, args: <Self::DB as Database>::Arguments<'a>, ) -> Result<Vec<SE>>
where SE: SelectedEntity<Self::DB> + Send + Unpin,

Source

async fn fetch_all_full_plain<'a, SE>( &'a mut self, stmt: &'a str, ) -> Result<Vec<SE>>
where SE: SelectedEntity<Self::DB> + Send + Unpin,

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§