org-roam / org-roam-server

A Web Application to Visualize the Org-Roam Database
MIT License
639 stars 51 forks source link

Can we have for each subdirectory a separate org-roam database? #49

Closed michaelsjackson closed 4 years ago

michaelsjackson commented 4 years ago

Example:

dir_a/1_org-roam.db
  dir_a1/2_org-roam.db
  dir_a2/3_org-roam.db
dir_b/4_org-roam.db
  dir_b1/5_org-roam.db
  dir_b2/6_org-roam.db

Can I have such 6 different org-roam.db files, each for its own subdirectory .org files?

I am asking because org-brain has such a similar feature, called org-brain-switch-brain, where you can switch to another directory. Wondering if org-roam has a similar feature. Then both could work always in parallel. Separate org-brain, and its parallel friend org-roam. For those cases where you do not want to mix up things.

goktug97 commented 4 years ago

This is not an org-roam-server related question, this is an org-roam related question and should be asked in org-roam repository.

You can have seperate org-roam directories by setting up dir-locals.el file. For example if you put .dir-locals.el file to a directory with the contents:

((nil . ((org-roam-directory . "/home/goktug/test-db"))))

you will have a seperate org roam instance. If you put a directory inside of an org-roam directory, it will act as a TAG.

├── db1
│   ├── .dir-locals.el
│   └── org-roam.db
├── db2
│   ├── .dir-locals.el
│   └── org-roam.db
├── db3
│   ├── .dir-locals.el
│   └── org-roam.db
└── org-roam.db

I can't see any practicial reason using org-roam this way.

michaelsjackson commented 4 years ago

Thanks for your explanations, can try it one day, sorry for offtopic asking here. Have a nice day.