ks-key-count added.
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
ks-key-values
|
ks-key-values
|
||||||
ks-key-values-raw
|
ks-key-values-raw
|
||||||
ks-keys-raw
|
ks-keys-raw
|
||||||
|
ks-key-count
|
||||||
)
|
)
|
||||||
|
|
||||||
(define-struct keystore
|
(define-struct keystore
|
||||||
@@ -71,6 +72,12 @@
|
|||||||
"SELECT key, value FROM keystore WHERE str_key GLOB $1"
|
"SELECT key, value FROM keystore WHERE str_key GLOB $1"
|
||||||
(string-downcase gl))))
|
(string-downcase gl))))
|
||||||
|
|
||||||
|
(define/contract (ks-key-count ksh)
|
||||||
|
(-> keystore? number?)
|
||||||
|
(let ((l (query-rows (keystore-dbh ksh)
|
||||||
|
"SELECT count(*) FROM keystore")))
|
||||||
|
(vector-ref (car l) 0)))
|
||||||
|
|
||||||
(define/contract (ks-keys-glob ksh sqlite-like)
|
(define/contract (ks-keys-glob ksh sqlite-like)
|
||||||
(-> keystore? string? list?)
|
(-> keystore? string? list?)
|
||||||
(map (λ (row)
|
(map (λ (row)
|
||||||
|
|||||||
Reference in New Issue
Block a user