summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-12-30 10:07:11 +0200
committerThanos Apollo <[email protected]>2023-12-30 10:07:11 +0200
commit425aea91564acda7bafa89f03710bfa3e7100c9d (patch)
tree35c1ea074958ff9e347e73ed4ffec7fb8c994202 /gnosis.el
parent9f86a5c875b4c43725833fcaf29a1e5efc06eef0 (diff)
Make sure gnosis-db has been in/zed before selecting/inserting value
Add gnosis-db-init to gnosis--insert-into & gnosis-select
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el2
1 files changed, 2 insertions, 0 deletions
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)