feat(core): nestable transactions, put_page and journals_before

Importer runs its write phase in one transaction (replaces the
synchronous=OFF workaround); the FFI journals feed uses journals_before
instead of walking back one day per query.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dasemuandClaude Opus 5.5 committed 2026-10-21 14:04:26 +02:00
1 parent 537d70bb55
commit 30d58a0166
4 files changed
+117 -26

No files matched your search

+3 -6
View File
@@ -182,12 +182,9 @@ pub fn import_logseq(
}
}
// Every core write commits on its own; without fsyncs that is cheap. A crash mid-import
// only needs a re-import (idempotent), so durability per commit is not required.
let _ = graph.conn().pragma_update(None, "synchronous", "OFF");
let result = write_all(graph, opts, &docs, &origin, &mut report, &mut progress);
let _ = graph.conn().pragma_update(None, "synchronous", "NORMAL");
result?;
// One transaction for the whole write phase: much faster, and a failed import leaves the
// graph untouched.
graph.transaction(|g| write_all(g, opts, &docs, &origin, &mut report, &mut progress))?;
Ok(report)
}