changelog shortlog graph tags branches changeset file revisions annotate raw help

Mercurial > core / lisp/lib/packy/db.lisp

revision 240: a3b65a8138ac
parent 234: d7aa08025537
child 369: de40bd522c84
     1.1--- a/lisp/lib/packy/db.lisp	Sat Mar 23 23:02:31 2024 -0400
     1.2+++ b/lisp/lib/packy/db.lisp	Sun Mar 24 21:46:43 2024 -0400
     1.3@@ -1,7 +1,5 @@
     1.4 (in-package :packy/core)
     1.5 
     1.6-(defvar *packy-dbs* nil)
     1.7-
     1.8 (defclass packy-database (database) ()
     1.9   (:default-initargs 
    1.10    :db (make-rdb "packy" (default-rdb-opts) #())))
    1.11@@ -10,8 +8,23 @@
    1.12   (apply #'make-instance 'packy-database initargs))
    1.13 
    1.14 (defmethod connect-db ((db packy-database) &key &allow-other-keys)
    1.15-  (with-slots (db) db
    1.16-      (open-db db)))
    1.17+  (open-db (db db)))
    1.18+
    1.19+(defmethod db-query ((db packy-database) query &key &allow-other-keys))
    1.20+  
    1.21+(defmethod db-get ((db packy-database) (key simple-string) &key &allow-other-keys)
    1.22+  ;; lol
    1.23+    (with-db (db (db db))
    1.24+      (get-kv-str-raw db key)))
    1.25 
    1.26-(defmethod query-db ((db packy-database) query &key &allow-other-keys))
    1.27-  
    1.28+(defmethod close-db ((db packy-database) &key &allow-other-keys)
    1.29+  (close-db (db db)))
    1.30+
    1.31+(defmethod destroy-db ((db packy-database))
    1.32+  (destroy-db (db db)))
    1.33+
    1.34+(defmethod get-val ((obj packy-database) (elt simple-string) &optional data-type)
    1.35+  (declare (ignore data-type))
    1.36+  (db-get obj elt))
    1.37+
    1.38+(defmethod get-db (dbs (name (eql :packy))))