changelog shortlog graph tags branches changeset files revisions annotate raw help

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

changeset 479: ff3b057402d1
parent: ea4f008ad13f
author: Richard Westhaver <ellis@rwest.io>
date: Tue, 25 Jun 2024 22:28:30 -0400
permissions: -rw-r--r--
description: light cleanup
1 ;;; db.lisp --- Packy Database
2 
3 ;;
4 
5 ;;; Code:
6 (in-package :packy/db)
7 
8 (defclass package-database (database) ()
9  (:default-initargs
10  :db (make-rdb "packy" (default-rdb-opts) #())))
11 
12 (defmethod make-db ((engine (eql :packy)) &rest initargs &key &allow-other-keys)
13  (apply #'make-instance 'package-database initargs))
14 
15 (defmethod connect-db ((db package-database) &key &allow-other-keys)
16  (open-db (db db)))
17 
18 (defmethod query-db ((db package-database) query &key &allow-other-keys))
19 
20 (defmethod db-get ((db package-database) (key simple-string) &key &allow-other-keys)
21  ;; lol
22  (with-db (db (db db))
23  (get-kv-str-raw db key)))
24 
25 (defmethod close-db ((db package-database) &key &allow-other-keys)
26  (close-db (db db)))
27 
28 (defmethod destroy-db ((db package-database))
29  (destroy-db (db db)))
30 
31 (defmethod get-val ((obj package-database) (elt simple-string) &optional data-type)
32  (declare (ignore data-type))
33  (db-get obj elt))
34 
35 (defmethod get-db (dbs (name (eql :packy))))