Org-roam revolves around the notion of a single org-roam-directory. Has anyone thought about the possibility of making it work with multiple root directories? Why? So then it would be possible to have wholly separated collections of notes. Like for example, to have a collaborative “wiki”, you’d just need to create a git repo and have all the notes contained within. And you wouldn’t have to worry about accidentally or otherwise linking to the notes that are not related or personal.
It would be great to be able to have “vaults” (for the lack of better words I’m using Obsidian.md term here), right?
Perhaps the concept of switchable “contexts”, where one can set up multiple root directories, e.g.: “default”, “work”, “book-club”, “flat-earthers-society”, etc. And the notes of one context would be completely separated from the others?
How difficult would it be to achieve something like that?
21.1 How do I have more than one Org-roam directory?
Emacs supports directory-local variables, allowing the value of org-roam-directory to be different in different directories. It does this by checking for a file named .dir-locals.el .
To add support for multiple directories, override the org-roam-directory variable using directory-local variables. This is what .dir-locals.el may contain:
All files within that directory will be treated as their own separate set of Org-roam files. Remember to run org-roam-db-build-cache from a file within that directory, at least once.
if you are asking me, I have no idea. I just referenced a section in the documentation. I don’t use it myself. …also I’m not sure if the error you see is related to this (?)
The example content for .dir-locals.el given in the documentation did not work in my case. When calling org-roam-db-build-cache for one of my org-roam root-directories, a UNIQUE constraint failed: files.file error always occured – even if the database was deleted first.
What does work for .dir-locals.el is the following: