diff options
author | Thanos Apollo <[email protected]> | 2023-12-14 13:19:15 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-12-14 13:19:45 +0200 |
commit | 4dd7f89cde9c95d43d601c4146ff24826cc28627 (patch) | |
tree | e2167ddbf6927aa4d23463f4239876202bbe31d6 | |
parent | 801cda946148a06953930ca6ce0c62cadebfa5c7 (diff) |
Add gnosis-update
-rw-r--r-- | gnosis.el | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -84,6 +84,12 @@ Used to calcuate new interval for failed questions." "Insert VALUES to TABLE." (emacsql gnosis-db `[:insert :into ,table :values ,values])) +(cl-defun gnosis-update (table value where) + "Update records in TABLE with to new VALUE based on the given WHERE condition. +Example: + (gnosis-update 'notes '(= main \"NEW VALUE\") '(= id 12))" + (emacsql gnosis-db `[:update ,table :set ,value :where ,where])) + (defun gnosis-get (value table &optional restrictions) "Get VALUE from TABLE, optionally with where RESTRICTIONS." (caar (gnosis--select value table restrictions))) @@ -230,7 +236,7 @@ TAGS are used to organize questions." (error (message "No NOTES table to drop."))) (condition-case nil (gnosis--drop-table 'decks) - (error (message "No NOTES table to drop."))) + (error (message "No DECKS table to drop."))) (condition-case nil (gnosis--drop-table 'review) (error (message "No REVIEW table to drop."))) |