ks-transaction added

This commit is contained in:
2026-06-29 09:09:32 +02:00
parent ce23e90231
commit 6f5ef123f9
+10
View File
@@ -19,6 +19,7 @@
ks-key-values-raw ks-key-values-raw
ks-keys-raw ks-keys-raw
ks-key-count ks-key-count
ks-transaction
) )
(define-struct keystore (define-struct keystore
@@ -104,6 +105,15 @@
(map vector->list (map vector->list
(query-rows (keystore-dbh ksh) "SELECT key, str_key, value FROM keystore"))) (query-rows (keystore-dbh ksh) "SELECT key, str_key, value FROM keystore")))
(define-syntax ks-transaction
(syntax-rules ()
((_ ks b1 ...)
(begin
(query-exec (keystore-dbh ks) "BEGIN")
(let ((r (begin b1 ...)))
(query-exec (keystore-dbh ks) "COMMIT")
r)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Internal working ;; Internal working
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;