From b388fd3db2a899f7feb680fdbc54ecce7a0e1dc3 Mon Sep 17 00:00:00 2001 From: N V <44036031+progfolio@users.noreply.github.com> Date: Wed, 13 May 2020 02:24:50 -0400 Subject: [PATCH] (refactor): org-roam-db--clear pull tables from schemata (#611) Programatically pull tables from schemata, rather than manually specifying each table. --- org-roam-db.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/org-roam-db.el b/org-roam-db.el index fe7f387..b34a48d 100644 --- a/org-roam-db.el +++ b/org-roam-db.el @@ -187,10 +187,8 @@ the current `org-roam-directory'." "Clears all entries in the caches." (interactive) (when (file-exists-p (org-roam-db--get)) - (org-roam-db-query [:delete :from files]) - (org-roam-db-query [:delete :from titles]) - (org-roam-db-query [:delete :from links]) - (org-roam-db-query [:delete :from refs]))) + (dolist (table (mapcar #'car org-roam-db--table-schemata)) + (org-roam-db-query `[:delete :from ,table])))) (defun org-roam-db--clear-file (&optional filepath) "Remove any related links to the file at FILEPATH.