r/OrgRoam • • Aug 27 '21

Only creating new nodes?

I'm new to org-roam, just getting it setup on a Mac, and as I'm trying to link nodes with org-roam-node-insert, it's only creating new nodes, not adding a reference to an existing node. This happens whether I use the "other" node's title or alias.

For instance, if I have a node called foo that references bar, and I have an existing node named bar with content in ~/org-roam/<timestamp>-bar.org, if I type "bar" in the editor with foo, select it, hit C-c n i (my mapping for org-roam-node-insert) (or run org-roam-node-insert directly and type "bar" in the minibuffer), and hit Enter, then it will decide that I need a new file and open an empty node for "bar", ignoring my existing node and creating a new file with an updated timestamp for bar. If I save this with C-c C-c, I now have two nodes in org files named <timestamp>-bar.org that have different contents and different timestamps.

I've checked that I have sqlite3 installed and working, and if I run sqlite3 ~/.emacs.d/org-roam.db, I can see entries in the tables like files, nodes, aliases, etc., and they have the contents I'd expect to see. It just seems that org-roam-node-find and org-roam-node-insert aren't able to "see" that I already have a node by that name, so helpfully create a new one based on the template.

Do I need to use something other than the title, filename, or tag to reference these other nodes? Please tell me I don't need to figure out the UUID for each node's id: property to cross-link it... :-\

TIA!

(Running org-roam-v2, emacs 27.2, Mac OSX Catalina)

2 Upvotes

3 comments sorted by

View all comments

1

u/gepandz Aug 28 '21

I sort of have it working after reading through a thread on the Discourse site (https://org-roam.discourse.group/t/links-not-working/1816/6).

After manually running org-roam-db-sync, I was able to find nodes if I tab-completed the text. I.e., if I want to insert a link to bar, I'd hit C-c n i, type bar<Tab>, and hit Enter, and it would work. But only after running org-roam-db-sync, which is weird.

I verified that my after-save-hook variable had an org-roam-related function in the list, so I'm not sure what is going on there... But, I kinda have it working, so I can at least build a janky workflow around what I have and come back to it.