transactions expanded.

This commit is contained in:
2026-06-29 09:49:27 +02:00
parent 82fe0996f0
commit 0efd6e14cc
2 changed files with 35 additions and 1 deletions
+19
View File
@@ -21,6 +21,9 @@
ks-key-count ks-key-count
ks-transaction ks-transaction
ks-commit ks-commit
ks-begin-transaction
ks-end-transaction
ks-abort-transaction
) )
(define-struct keystore (define-struct keystore
@@ -123,6 +126,22 @@
(query-exec (keystore-dbh ks) "BEGIN") (query-exec (keystore-dbh ks) "BEGIN")
#t) #t)
(define/contract (ks-begin-transaction ks)
(-> keystore? boolean?)
(query-exec (keystore-dbh ks) "BEGIN")
#t)
(define/contract (ks-end-transaction ks)
(-> keystore? boolean?)
(query-exec (keystore-dbh ks) "COMMIT")
#t)
(define/contract (ks-abort-transaction ks)
(-> keystore? boolean?)
(query-exec (keystore-dbh ks) "ROLLBACK")
#t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Internal working ;; Internal working
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+16 -1
View File
@@ -134,7 +134,22 @@ it will do a "BEGIN/ROLLBACK" abd re-raise the exception.
Commits (part of a transaction) using COMMIT/BEGIN. Commits (part of a transaction) using COMMIT/BEGIN.
Fits in a @tt{ks-transaction} form. Fits in a @tt{ks-transaction} form.
} }
@defproc[(ks-begin-transaction [ks keystore?]) boolean?]{
Begins a transaction with "BEGIN".
}
@defproc[(ks-end-transaction [ks keystore?]) boolean?]{
Commits a transaction with "COMMIT".
}
@defproc[(ks-abort-transaction [ks keystore?]) boolean?]{
Aborts a transaction with "ROLLBACK".
}
@section{Examples} @section{Examples}