Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion examples/logseq_sqlite_storage.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,10 @@ let storage db_path =
create_kvs_table db_path;
let store entries =
let sql = String.concat "" (List.map upsert_sql entries) in
if sql <> "" then exec_sql db_path sql
(* Without an explicit transaction sqlite3_exec commits every
statement separately — thousands of fsyncs on a bulk store.
One transaction costs one commit's worth of syncs. *)
if sql <> "" then exec_sql db_path ("begin immediate;" ^ sql ^ "commit;")
in
let restore address =
let addr = sqlite_addr_of_storage_address address in
Expand Down
Loading