diff --git a/CHANGELOG b/CHANGELOG index dabd108..01aa82b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,11 @@ # -*- mode: org -*- +* v1.1.0 2021/09/27 + +- Added support for alternative database connectors. + The ~closql-database~ class is abstract now, making it necessary to + define a class that derives from that and also from a connector + class. + * v1.0.6 2021/06/16 - Adjusted to how unbound slots are represented in Emacs 28. diff --git a/closql.el b/closql.el index e73b26b..6b184ce 100644 --- a/closql.el +++ b/closql.el @@ -273,8 +273,9 @@ ;;; Database -(defclass closql-database (emacsql-sqlite-connection) - ((object-class :allocation :class))) +(defclass closql-database () + ((object-class :allocation :class)) + :abstract t) (cl-defmethod closql-db ((class (subclass closql-database)) &optional variable file debug) @@ -283,7 +284,8 @@ (prog1 db (emacsql db [:pragma (= foreign-keys on)])))) (let ((db-init (not (and file (file-exists-p file)))) (db (make-instance class :file file))) - (set-process-query-on-exit-flag (oref db process) nil) + (when (slot-boundp db 'process) + (set-process-query-on-exit-flag (oref db process) nil)) (when debug (emacsql-enable-debugging db)) (emacsql db [:pragma (= foreign-keys on)])