cl-kyoto-cabinet

2012-05-20
(in-package :kyoto-cabinet)
(defparameter *db* (make-instance 'kc-dbm))
(dbm-open *db* "/tmp/hello.kch" :create :write)

(dbm-put *db* "Ilya" "Sterin" :mode :keep)
(dbm-get *db* "Ilya")
(dbm-remove *db* "Ilya")

(dbm-put *db* 123 "456" :mode :keep)
(dbm-get *db* 123)
(dbm-remove *db* 123)

(defparameter *iter* (iter-open *db*))
(iter-first *iter*)
(multiple-value-bind (key val) (iter-item *iter*) (list key val))
(iter-next *iter*)

(dbm-put *db* 123 (make-array 2 :initial-contents '(75 76) :element-type '(unsigned-byte 8)) :mode :replace)
(dbm-put *db* 123 (make-octet-vector 100 101) :mode :replace)

(multiple-value-bind (key val) (iter-item *iter* :key-type :integer) (list key val))
Author
Kevin Raison <last name @ chatsubo dot net>
License
New BSD