summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnosis.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/gnosis.el b/gnosis.el
index 951e61b..0098665 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -45,7 +45,6 @@
;;; Code:
-(require 'emacsql)
(require 'emacsql-sqlite)
(require 'cl-lib)
@@ -146,9 +145,12 @@
"Face for next review."
:group 'gnosis-face)
-(cl-defun gnosis-select (value table &optional (restrictions '1=1))
+(cl-defun gnosis-select (value table &optional (restrictions '1=1) (flatten nil))
"Select VALUE from TABLE, optionally with RESTRICTIONS."
- (emacsql gnosis-db `[:select ,value :from ,table :where ,restrictions]))
+ (let ((output (emacsql gnosis-db `[:select ,value :from ,table :where ,restrictions])))
+ (if flatten
+ (apply #'append output)
+ output)))
(cl-defun gnosis--create-table (table &optional values)
"Create TABLE for VALUES."