commits in between.

This commit is contained in:
2026-06-29 09:29:12 +02:00
parent 156177cd5d
commit 93982d6630
2 changed files with 14 additions and 0 deletions
+7
View File
@@ -20,6 +20,7 @@
ks-keys-raw ks-keys-raw
ks-key-count ks-key-count
ks-transaction ks-transaction
ks-commit
) )
(define-struct keystore (define-struct keystore
@@ -116,6 +117,12 @@
(query-exec (keystore-dbh ks) "COMMIT") (query-exec (keystore-dbh ks) "COMMIT")
r))))) r)))))
(define/contract (ks-commit ks)
(-> keystore? boolean?)
(query-exec (keystore-dbh ks) "COMMIT")
(query-exec (keystore-dbg ks) "BEGIN")
#t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Internal working ;; Internal working
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+7
View File
@@ -121,6 +121,7 @@ Returns raw key-value rows in the form:
] ]
} }
@section{Transactions}
@defform[(ks-transaction [ks keystore?] b1 ...)]{ @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. 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} @section{Examples}
@subsection{Basic Usage} @subsection{Basic Usage}