From 57c7caad79cfac72c19bda309ba36e3c3ed0e4f5 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Thu, 21 Nov 2024 01:09:14 +0200 Subject: db: Add delete value & drop table functions --- org-gnosis.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'org-gnosis.el') diff --git a/org-gnosis.el b/org-gnosis.el index acedb26..363bc4f 100644 --- a/org-gnosis.el +++ b/org-gnosis.el @@ -66,6 +66,14 @@ Optional argument FLATTEN, when non-nil, flattens the result." "Insert VALUES to TABLE." (emacsql org-gnosis-db `[:insert :into ,table :values ,values])) +(defun org-gnosis--delete (table value) + "From TABLE use where to delete VALUE." + (emacsql org-gnosis-db `[:delete :from ,table :where ,value])) + +(cl-defun org-gnosis--drop-table (table) + "Drop TABLE from `gnosis-db'." + (emacsql org-gnosis-db `[:drop-table ,table])) + (defun org-gnosis-get-current-node-title () "Return the title of the current node." (when (derived-mode-p 'org-mode) -- cgit v1.2.3