Skip to main content

gluesql_core/store/
transaction.rs

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