branch: elpa/gnosis commit 02552618c4e997533ae48b55106cba2c6b374e71 Author: Thanos Apollo <pub...@thanosapollo.org> Commit: Thanos Apollo <pub...@thanosapollo.org>
Remove cl-defun + Default defun is more "predictable" on how the optional values are set. --- gnosis.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gnosis.el b/gnosis.el index 74de947ed8..386365c496 100644 --- a/gnosis.el +++ b/gnosis.el @@ -231,32 +231,32 @@ Optional argument FLATTEN, when non-nil, flattens the result." (cdr (gnosis-select 'name 'sqlite-master '(= type table) t))))) (member (symbol-name table) tables))) -(cl-defun gnosis--create-table (table &optional values) +(defun gnosis--create-table (table &optional values) "Create TABLE for VALUES." (unless (gnosis-table-exists-p table) (emacsql gnosis-db `[:create-table ,table ,values]))) -(cl-defun gnosis--drop-table (table) +(defun gnosis--drop-table (table) "Drop TABLE from `gnosis-db'." (emacsql gnosis-db `[:drop-table ,table])) -(cl-defun gnosis-drop-table (table) +(defun gnosis-drop-table (table) "Drop TABLE from `gnosis-db'." (when (gnosis-table-exists-p table) (gnosis--drop-table table))) -(cl-defun gnosis--insert-into (table values) +(defun gnosis--insert-into (table values) "Insert VALUES to TABLE." (emacsql gnosis-db `[:insert :into ,table :values ,values])) -(cl-defun gnosis-update (table value where) +(defun gnosis-update (table value where) "Update records in TABLE with to new VALUE based on the given WHERE condition. Example: (gnosis-update ='notes ='(= keimenon \"NEW VALUE\") ='(= id 12))" (emacsql gnosis-db `[:update ,table :set ,value :where ,where])) -(cl-defun gnosis-get (value table &optional (restrictions '1=1)) +(defun gnosis-get (value table &optional restrictions) "Return caar of VALUE from TABLE, optionally with where RESTRICTIONS." (caar (gnosis-select value table restrictions)))