pub struct Database { /* private fields */ }Implementations§
Source§impl Database
impl Database
pub async fn get(&self, pk: &str, sk: &str) -> Result<Option<Bytes>>
pub async fn put(&self, pk: &str, sk: &str, data: &[u8]) -> Result<()>
pub async fn delete(&self, pk: &str, sk: &str) -> Result<()>
pub fn mock_get(&self, pk: &str, sk: &str) -> MockGetBuilder<'_>
pub fn mock_put(&self, pk: &str, sk: &str) -> MockPutBuilder<'_>
pub fn mock_delete(&self, pk: &str, sk: &str) -> MockDeleteBuilder<'_>
pub fn clear_mocks(&self)
pub async fn query<S1: AsRef<str>, S2: AsRef<str>>( &self, pk: S1, after_sk: Option<S2>, limit: usize, ) -> Result<Vec<(String, Bytes)>>
pub async fn scan( &self, after: Option<(&str, &str)>, limit: usize, ) -> Result<Vec<(String, String, Bytes)>>
pub async fn execute_semantic( &self, request: DocDbRequest, ) -> Result<DocDbResponse>
pub async fn admin_purge_project(&self, project_id: &str) -> Result<u64>
pub async fn transaction(&self) -> Result<Transaction>
pub async fn trx<F, Fut, Out, Cancel, E>( &self, f: F, ) -> TrxResult<Out, Cancel, E>
pub async fn execute_raw( &self, sql: &str, args: Vec<Value>, want_rows: bool, ) -> Result<Vec<Vec<Value>>>
Sourcepub async fn execute_raw_transactional(
&self,
statements: &[RawStatement],
) -> Result<RawTransactionOutcome>
pub async fn execute_raw_transactional( &self, statements: &[RawStatement], ) -> Result<RawTransactionOutcome>
Runs the statements as a single transaction (all-or-nothing) and
returns, per statement, the result rows together with the engine’s own
rows_read / rows_written counters — the numbers Turso bills by.
A statement failure rolls the whole transaction back and is reported as
RawTransactionOutcome::RolledBack, not as Err.
Turso backend only; the in-memory test backend rejects it.
pub async fn execute_raw_transactional_readonly( &self, statements: &[RawStatement], ) -> Result<RawTransactionOutcome>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Database
impl !UnwindSafe for Database
impl Freeze for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnsafeUnpin for Database
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