From 93982d6630948a77f92f2817f4c3bb575c98d8d1 Mon Sep 17 00:00:00 2001 From: Hans Dijkema Date: Mon, 29 Jun 2026 09:29:12 +0200 Subject: [PATCH] commits in between. --- keystore.rkt | 7 +++++++ scrbl/keystore.scrbl | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/keystore.rkt b/keystore.rkt index bb3bc88..0f1adb0 100644 --- a/keystore.rkt +++ b/keystore.rkt @@ -20,6 +20,7 @@ ks-keys-raw ks-key-count ks-transaction + ks-commit ) (define-struct keystore @@ -116,6 +117,12 @@ (query-exec (keystore-dbh ks) "COMMIT") r))))) +(define/contract (ks-commit ks) + (-> keystore? boolean?) + (query-exec (keystore-dbh ks) "COMMIT") + (query-exec (keystore-dbg ks) "BEGIN") + #t) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Internal working ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/scrbl/keystore.scrbl b/scrbl/keystore.scrbl index 23e1baf..c6a33d0 100644 --- a/scrbl/keystore.scrbl +++ b/scrbl/keystore.scrbl @@ -121,6 +121,7 @@ Returns raw key-value rows in the form: ] } +@section{Transactions} @defform[(ks-transaction [ks keystore?] b1 ...)]{ @@ -129,6 +130,12 @@ It uses with-handlers exn?, so if you raise an exception, it will do a "BEGIN/ROLLBACK" abd re-raise the exception. } +@defproc[(ks-commit [ks keystore?]) boolean?]{ + +Commits (part of a transaction) using COMMIT/BEGIN. +Fits in a @tt{ks-transaction} form. +} + @section{Examples} @subsection{Basic Usage}