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.
SQL databases are most useful for data that may be represented naturally using a relational model.
XML and JSON databases are needed when the data consists of documents already occurring in such formats, and which must be stored without loss of their structure and must be queried and manipulated according the relationships captured in the structure.
You’ve probably seen that a single BaseX database is a directory with multiple files.
Multiple files versus one would not be an issue.
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 could follow this design in principle, but I worry it is prone to breakage. There are ancillary issues too, such as the side effect of new files appearing under the user home directory.
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?
The plan had been to prototype using a Bash script and query files, before resolving whether a more sophisticated approach would be warranted.