pub trait DatabaseConnection {
// Required methods
fn backend(&self) -> DatabaseBackend;
fn query<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
) -> Pin<Box<dyn Future<Output = DatabaseResult<Box<dyn RowIterator>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
数据库连接 trait
Required Methods§
Sourcefn backend(&self) -> DatabaseBackend
fn backend(&self) -> DatabaseBackend
获取数据库后端类型
Sourcefn query<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
) -> Pin<Box<dyn Future<Output = DatabaseResult<Box<dyn RowIterator>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
) -> Pin<Box<dyn Future<Output = DatabaseResult<Box<dyn RowIterator>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
执行查询