From 425aea91564acda7bafa89f03710bfa3e7100c9d Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 30 Dec 2023 10:07:11 +0200 Subject: Make sure gnosis-db has been in/zed before selecting/inserting value Add gnosis-db-init to gnosis--insert-into & gnosis-select --- gnosis.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gnosis.el b/gnosis.el index 7482ff7..9c1dc89 100644 --- a/gnosis.el +++ b/gnosis.el @@ -63,6 +63,7 @@ WARNING: Do not change this value!") (cl-defun gnosis-select (value table &optional (restrictions '1=1)) "Select VALUE from TABLE, optionally with RESTRICTIONS." + (gnosis-db-init) (emacsql gnosis-db `[:select ,value :from ,table :where ,restrictions])) (cl-defun gnosis--create-table (table &optional values) @@ -75,6 +76,7 @@ WARNING: Do not change this value!") (cl-defun gnosis--insert-into (table values) "Insert VALUES to TABLE." + (gnosis-db-init) (emacsql gnosis-db `[:insert :into ,table :values ,values])) (cl-defun gnosis-update (table value where) -- cgit v1.2.3