(refactor): org-roam-db--clear pull tables from schemata (#611)

Programatically pull tables from schemata, rather than manually
specifying each table.
This commit is contained in:
N V
2020-05-13 02:24:50 -04:00
committed by GitHub
parent e0cefa7377
commit b388fd3db2

View File

@@ -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.