I am looking for some ideas on some architecture surrounding xquery modules.
Our situation is that we have multiple client applications in various languages that will connect to a database.
We will have some reasonably complex xqueries to extract data in certain structures that will be used by each of these clients.
So to avoid having to duplicate the query logic we would like the xqueries to reside "in" the database.
Additionally, we would like to use the same BaseX installation for multiple databases, corresponding to multiple projects.
The data in each of these databases may be against a different schema and our xqueries are essentially tied to the schema of the data. Thus, each database may need slightly different xqueries.
The xquery library modules looks to be global for the BaseX instance, as does the loading of main modules off of disk.
Is there any way to tie the query module or file to a specific database?
We are trying to avoid being limited to 1 database per BaseX instance.
An alternative would be to embed the xqueries within our client applications, but that involves duplication. Also, we are not sure if there are any performance difference with having the queries stored in the repo vs client side?
For background, we are looking at migrating from oracle to BaseX. So, we are effectively looking for an equivalent of multiple clients connecting to a userspace and using stored procedures which are specific to that userspace.
Any ideas on how to achieve this currently? Or is this something that BaseX could support?
Cheers,
Chris