Hi Eric,

There is currently no limit to the number of projects in a system (besides storage and memory, of course). BaseX databases can point anywhere they need to in the file system, so there's no reason for the database files themselves to live in different child folders.

For example, on our Ubuntu server the databases are written to /opt/basex/data, while the files the databases represent live in /home/[user]/public_html/repos/[various children]/files. When we create new repositories, we put the files in a new folder and create the BaseX database like: CREATE DB new_name /home/[user]/public_html/repos/new_repo/files. We haven't used BaseX in more than one project yet, but if we did we'd just make more databases pointing at directories under a new /home/[user].

The only reason I can think of that storing the BaseX database files in different subfolders might be handy is if you need each of the sub-projects to be portable, but IME trying to copy BaseX database files into a new system doesn't work well. It's better to get all of your scripts in place for creating the databases, and just re-run them when the project is ready in its new home.

-Tamara

On Mon, Feb 21, 2022 at 1:16 AM Christian Grün <christian.gruen@gmail.com> wrote:
> I have already drawn an analogy to a pattern that has become widespread for using SQLite.

Maybe it helps to compare BaseX with other Open-Source SQL databases,
e.g. PostgreSQL: While it’s possibly to use it embedded, specifying a
simple path as target won’t suffice.

You’ve probably seen that a single BaseX database is a directory with
multiple files.

> if the location of the project were given as "/path/to/project", then the application would need to open a database given at "/path/to/project/database".

What about assigning "/path/to/project/database" to DBPATH and storing
your single database as a sub-directory of that folder?

> I am not sure what more information to give,

I was wondering if you use Java, the command line or something else to
communicate with BaseX.

But If I understand you correctly, you haven’t embedded BaseX yet, but
you would like to do so?


--

Tamara Marnell
Program Manager, Systems
Orbis Cascade Alliance (orbiscascade.org)
Pronouns: she/her/hers