gluesql_core/store/
transaction.rs

1use {
2    crate::result::{Error, Result},
3    async_trait::async_trait,
4};
5
6#[async_trait(?Send)]
7pub trait Transaction {
8    async fn begin(&mut self, autocommit: bool) -> Result<bool> {
9        if autocommit {
10            return Ok(false);
11        }
12
13        Err(Error::StorageMsg(
14            "[Storage] Transaction::begin is not supported".to_owned(),
15        ))
16    }
17
18    async fn rollback(&mut self) -> Result<()> {
19        Ok(())
20    }
21
22    async fn commit(&mut self) -> Result<()> {
23        Ok(())
24    }
25}