ks-transaction added
This commit is contained in:
@@ -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
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|||||||
Reference in New Issue
Block a user