pub struct TursoConnection { /* private fields */ }Expand description
Turso 连接包装
Trait Implementations§
Source§impl DatabaseConnection for TursoConnection
impl DatabaseConnection for TursoConnection
Source§fn backend(&self) -> DatabaseBackend
fn backend(&self) -> DatabaseBackend
获取数据库后端类型
Source§fn query<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
) -> Pin<Box<dyn Future<Output = DatabaseResult<DatabaseRows>> + 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<DatabaseRows>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
执行查询,返回结果集
Source§fn query_with<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: Vec<Value>,
) -> Pin<Box<dyn Future<Output = DatabaseResult<DatabaseRows>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_with<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: Vec<Value>,
) -> Pin<Box<dyn Future<Output = DatabaseResult<DatabaseRows>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
执行带参数的查询 (使用 wae_types::Value)
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
) -> Pin<Box<dyn Future<Output = DatabaseResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
) -> Pin<Box<dyn Future<Output = DatabaseResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
执行语句,返回影响的行数
Source§fn execute_with<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: Vec<Value>,
) -> Pin<Box<dyn Future<Output = DatabaseResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute_with<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: Vec<Value>,
) -> Pin<Box<dyn Future<Output = DatabaseResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
执行带参数的语句 (使用 wae_types::Value)
Source§fn prepare<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
) -> Pin<Box<dyn Future<Output = DatabaseResult<DatabaseStatement>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn prepare<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
) -> Pin<Box<dyn Future<Output = DatabaseResult<DatabaseStatement>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
准备语句
Source§fn begin_transaction<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DatabaseResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn begin_transaction<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DatabaseResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
开始一个新事务
Source§fn commit<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DatabaseResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn commit<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DatabaseResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
提交当前事务
Source§fn rollback<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DatabaseResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn rollback<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DatabaseResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
回滚当前事务
Source§fn query_with_turso<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: Vec<TursoValue>,
) -> Pin<Box<dyn Future<Output = DatabaseResult<DatabaseRows>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_with_turso<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: Vec<TursoValue>,
) -> Pin<Box<dyn Future<Output = DatabaseResult<DatabaseRows>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
执行带参数的查询 (内部使用 turso::Value)
Source§fn execute_with_turso<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: Vec<TursoValue>,
) -> Pin<Box<dyn Future<Output = DatabaseResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute_with_turso<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: Vec<TursoValue>,
) -> Pin<Box<dyn Future<Output = DatabaseResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
执行带参数的语句 (内部使用 turso::Value)
Auto Trait Implementations§
impl !Freeze for TursoConnection
impl !RefUnwindSafe for TursoConnection
impl Send for TursoConnection
impl Sync for TursoConnection
impl Unpin for TursoConnection
impl UnsafeUnpin for TursoConnection
impl !UnwindSafe for TursoConnection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more