Differences From Artifact [1e4a5aef9c]:

To Artifact [672ac89374]:


8
9
10
11
12
13
14
15

16
17

18
19
20
21




22
23
24
25

26
27
8
9
10
11
12
13
14

15
16

17




18
19
20
21




22









-
+

-
+
-
-
-
-
+
+
+
+
-
-
-
-
+
-
-
;;  PURPOSE.

;;======================================================================
;; The meta data key store, just a general dumping ground for values
;; only used occasionally
;;======================================================================

(declare (unit keystore))
;; (declare (unit keystore))

(define (keystore:get db key)
(module keystore
  (dbi:get-one db "SELECT value FROM metadata WHERE key=?;" key))

(define (keystore:set! db key value)
  (let ((curr-val (keystore:get db key)))
    *

(import chicken scheme data-structures extras srfi-13 ports )

    (if curr-val
	(dbi:exec db "UPDATE metadata SET value=? WHERE key=?;" value key)
	(dbi:exec db "INSERT INTO metadata (key,value) VALUES (?,?);" key value))))

)
(define (keystore:del! db key)
  (dbi:exec db "DELETE FROM metadata WHERE key=?;" key))