SQLite engine: transactional seam — begin_tx, writer-slot lease, all eleven *_tx methods (task sqlite-engine-seam-tx)
This commit is contained in:
1 parent
7d400906f5
commit
c38033db1a
8 files changed
+1988
-20
No files matched your search
@@ -112,7 +112,12 @@ impl Store for SqliteStore {
|
||||
fn begin_tx(
|
||||
&self,
|
||||
) -> alkstore::BoxedFuture<'_, alkstore::Result<Box<dyn alkstore::TxHandle + Send>>> {
|
||||
Box::pin(async { Err(database_error("begin_tx wiring lands with the seam task")) })
|
||||
let writer = self.writer.clone();
|
||||
let db_path = self.db_path.to_string_lossy().into_owned();
|
||||
let reopen: std::sync::Arc<
|
||||
dyn Fn() -> alkstore::Result<rusqlite::Connection> + Send + Sync,
|
||||
> = std::sync::Arc::new(move || crate::substrate::open_writer_connection(&db_path));
|
||||
crate::tx::SqliteTxHandle::begin(writer, reopen)
|
||||
}
|
||||
|
||||
fn notify<'a>(
|
||||
@@ -218,3 +223,5 @@ impl Store for SqliteStore {
|
||||
|
||||
#[cfg(test)]
|
||||
mod open_tests;
|
||||
#[cfg(test)]
|
||||
mod tx_tests;
|
||||
Reference in new issue
Block a user