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}