Hi Eric,
It’s not possible to specify a dynamic path to a single database, but you can change the path to the database directory before you start BaseX. This can e.g. be done via system properties, either on command line …
java -Dorg.basex.dbpath=/custom/path/ -cp basex.jar org.basex.BaseX
…or via Java:
System.setProperty('org.basex.dbpath', '/custom/path/');
Please note that DBPATH is a “global option” [1]. As such, it cannot be changed anymore after BaseX has been started.
Best, Christian
[1] https://docs.basex.org/wiki/Options
On Thu, Feb 17, 2022 at 4:54 AM Eric Levy contact@ericlevy.name wrote:
I am targeting an application that would incorporate BaseX databases into larger projects, each following a standard file tree. As such, it is necessary for the application to interact with a database given by some path relative to the working directory.
The application is structured as to provide query files through the command line in a standalone invocation.
The documentation explains that the normal case is to resolve a directory in which all databases are stored, with each separate database in a sub-directory having the same name as the database.
What support is available for the case in which the application must resolve the path to the database independent of the normal rules?