I am not sure what more information to give, as I have already drawn an analogy to a pattern that has become widespread for using SQLite.
Essentially, an application would operate on a project directory, which would follow a particular hierarchy. Among the items in the hierarchy would be a database. The application would need to open the database, perform queries, and then finally close the database, as part of a larger operation.
The project hierarchy would be represented in the application logic. For example, the application might place the database in a location called "database" at the top level of the project folder. As such, 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". In this sense, the database would be simply an equal member of the file tree, just as would be a log file placed at "/path/to/project/logfile". If the file tree "/path/to/project" were copied to another host, and the new location were "/srv/proj/", then the database would be opened from "/srv/proj/database" when the application were invoked on the new host.
As projects would be just collections of files, there would be no limit to the number of such projects that may reside or the same system, and there would be no need to register them in any system configuration. They would be just files, as any other files.
On Sun, 2022-02-20 at 16:36 +0100, Christian Grün wrote:
Hi Eric,
While it’s possible to use BaseX in an embedded way, it’s actually more than that:
• The existence of a persistent home directory is a focal aspect of BaseX, many features rely on that [1]. • Users, jobs, database logs and other information is kept in this directory, and is not limited to a single database instance. • The implementation of XQuery allows you to access and update multiple databases, and many features would need to be limited if we introduced the concept of a single database.
Maybe we can help you out by learning more about your use case: How do you currently embed BaseX?
Best, Christian
[1] https://docs.basex.org/wiki/Configuration
On Sat, Feb 19, 2022 at 10:48 PM Eric Levy contact@ericlevy.name wrote:
I recently learned that BaseX offers no true support for access to a database given directly by its path.
In contrast, opening a database by file path is a well-established pattern in embedded databases, seen for example in SQLite, which permits use of any database given by an arbitrary path, without any dependence on external configuration or other data elsewhere on the system.
I wish to submit as a feature request the suggestion that BaseX include similar support.