(internal): rename link columns (#1213)

from -> source
to -> dest

"from" is a reserved keyword in sqlite, so we avoid it.
This commit is contained in:
Jethro Kuan
2020-10-25 22:33:43 +08:00
committed by GitHub
parent b937bc9655
commit bd8b5587f5
4 changed files with 33 additions and 33 deletions

View File

@ -300,21 +300,21 @@
;; Links
(expect (caar (org-roam-db-query [:select (funcall count) :from links
:where (= from $s1)]
:where (= source $s1)]
(test-org-roam--abs-path "foo.org"))) :to-be 1)
(expect (caar (org-roam-db-query [:select (funcall count) :from links
:where (= from $s1)]
:where (= source $s1)]
(test-org-roam--abs-path "nested/bar.org"))) :to-be 2)
;; Links -- File-to
(expect (caar (org-roam-db-query [:select (funcall count) :from links
:where (= to $s1)]
:where (= dest $s1)]
(test-org-roam--abs-path "nested/foo.org"))) :to-be 1)
(expect (caar (org-roam-db-query [:select (funcall count) :from links
:where (= to $s1)]
:where (= dest $s1)]
(test-org-roam--abs-path "nested/bar.org"))) :to-be 1)
(expect (caar (org-roam-db-query [:select (funcall count) :from links
:where (= to $s1)]
:where (= dest $s1)]
(test-org-roam--abs-path "unlinked.org"))) :to-be 0)
;; TODO Test titles
(expect (org-roam-db-query [:select * :from titles])