1 (in-package :packy/core) 2 3 (defclass packy-database (database) () 4 (:default-initargs 5 :db (make-rdb "packy" (default-rdb-opts) #()))) 6 7 (defmethod make-db ((engine (eql :packy)) &rest initargs &key &allow-other-keys) 8 (apply #'make-instance 'packy-database initargs)) 9 10 (defmethod connect-db ((db packy-database) &key &allow-other-keys) 11 (open-db (db db))) 12 13 (defmethod db-query ((db packy-database) query &key &allow-other-keys)) 14 15 (defmethod db-get ((db packy-database) (key simple-string) &key &allow-other-keys) 16 ;; lol 17 (with-db (db (db db)) 18 (get-kv-str-raw db key))) 19 20 (defmethod close-db ((db packy-database) &key &allow-other-keys) 21 (close-db (db db))) 22 23 (defmethod destroy-db ((db packy-database)) 24 (destroy-db (db db))) 25 26 (defmethod get-val ((obj packy-database) (elt simple-string) &optional data-type) 27 (declare (ignore data-type)) 28 (db-get obj elt)) 29 30 (defmethod get-db (dbs (name (eql :packy))))