feature request: opening database at arbitrary file path
Wednesday, 23 February 2022 · 9 messages · last reply 3 Mar 2022
CG
Christian Grün23 Feb 2022 00:56 #
Quoting my previous reply:
Quoted text · 1 line
> For example, you can
prevent BaseX from reading the configuration from disk [1].
And one more quote (as I’m not sure it has been fully understood):
Quoted text · 1 line
> In other words, if we use BaseX embedded, we import it as Java library.
If we use it as standalone processor, we access it externally, similar to other installed applications and along with all their idiosyncrasies.
If you call BaseX as an external and independent application via scripting, you can't expect it to behave like an embedded library.
Quoted text · Christian Grün · 21 lines
Eric Levy <contact at ericlevy.name> schrieb am Mi., 23. Feb. 2022, 00:43: > On Wed, 2022-02-23 at 00:22 +0100, Christian Grün wrote: > > > I understand the distinction. It seems the issues I originally > > > raised > > > would be the same in both cases. The difference is whether the > > > application would be built as a collection of scripts versus a full > > > Java application. > > > > As I tried to explain, no configuration files will be written to disk > > if BaseX is invoked via Java as described. I understood that's one of > > the side effects you wanted to circumvent? > > I do want to avoid writing (or reading) configuration files. > > Are you explaining that these files would be accessed by the standalone > application that is packaged with the distribution, but their use may > be avoided by accessing the database directly through the library layer > from a custom application? > > >
CG
Quoted text · Eric Levy · 1 line
> The design seems to present a dilemma, as it is unlikely that there would
be a viable route for beginning work on a Java application, before a concept is proved through much more lightweight development approaches.
It depends on you.
Quoted text · Eric Levy · 1 line
> Returning to the thought of a feature request, let me suggest that adding
switches to the command-line tool
We could add an option for preventing BaseX to read and write the initial configuration file, but we'd then still need to define a home directory in which new databases, users, jobs, etc. are stored. How would you handle that? Have you already checked out the Configuration article in our Wiki that has been referenced multiple times in this thread?
EL
Quoted text · Christian Grün · 15 lines
On Wed, 2022-02-23 at 00:56 +0100, Christian Grün wrote: > Quoting my previous reply: > > > For example, you can > prevent BaseX from reading the configuration from disk [1]. > > And one more quote (as I’m not sure it has been fully understood): > > > In other words, if we use BaseX embedded, we import it as Java > library. If we use it as standalone processor, we access it > externally, similar to other installed applications and along with > all their idiosyncrasies. > > If you call BaseX as an external and independent application via > scripting, you can't expect it to behave like an embedded library.
Thank you for reiterating the previous points, to help me see how they converge.
I understand the behavior of using configuration files may be disabled through the library call, but is unconditional through the command-line application.
The design seems to present a dilemma, as it is unlikely that there would be a viable route for beginning work on a Java application, before a concept is proved through much more lightweight development approaches.
Returning to the thought of a feature request, let me suggest that adding switches to the command-line tool, for disabling the behavior mentioned above, and other behavior that may be relevant, or providing a complementary tool targeted at more self-contained deployments, might be a valuable enhancement to the tool chain.
EL
Quoted text · Christian Grün · 8 lines
On Wed, 2022-02-23 at 23:09 +0100, Christian Grün wrote: > > Returning to the thought of a feature request, let me suggest that > adding switches to the command-line tool > > We could add an option for preventing BaseX to read and write the > initial configuration file, but we'd then still need to define a home > directory in which new databases, users, jobs, etc. are stored. How > would you handle that?
My first thought would be simply to expose to the command line the flag in the constructor you had referenced.
The base case for an embedded database has no user model, and supports creation of new databases only through the target path. However, such differences might press the limits of a benign request.
If a target path is needed beyond the database itself, then it might be passed on the command line. Alternatively, a special directory layout might be considered which encloses both the database files and the auxiliary configuration files, as peer sub-directories in the same parent, following a static layout utilized only when the application is invoked in some special mode.
Quoted text · Christian Grün · 2 lines
> Have you already checked out the Configuration article in our Wiki > that has been referenced multiple times in this thread?
Yes, but it doesn't mean I understand quite yet how all the parts fit together. Does it seem I missed or misunderstood something?
CG
Christian Grün24 Feb 2022 11:05 #
Quoted text · Eric Levy · 7 lines
> The base case for an embedded database has no user model, and supports > creation of new databases only through the target path. However, such > differences might press the limits of a benign request. > > If a target path is needed beyond the database itself, then it might be > passed on the command line. Alternatively, a special directory layout > might be considered […]
In both cases, we’d rebuild the existing solution step by step. And if no such path is specified by the user, we’d need to ensure for all operations in the system that nothing unexpected happens.
Quoted text · Eric Levy · 2 lines
> Yes, but it doesn't mean I understand quite yet how all the parts fit > together. Does it seem I missed or misunderstood something?
I guess so. What other parts of our documentation have you read so far to get a more comprehensive picture?
EL
Eric Levy25 Feb 2022 09:37 #
Quoted text · Christian Grün · 16 lines
> > The base case for an embedded database has no user model, and > > supports > > creation of new databases only through the target path. However, > > such > > differences might press the limits of a benign request. > > > > If a target path is needed beyond the database itself, then it > > might be > > passed on the command line. Alternatively, a special directory > > layout > > might be considered […] > > In both cases, we’d rebuild the existing solution step by step. And > if > no such path is specified by the user, we’d need to ensure for all > operations in the system that nothing unexpected happens.
Sorry, I don't understand the meaning of the comment.
Quoted text · Christian Grün · 7 lines
> > Yes, but it doesn't mean I understand quite yet how all the parts > > fit > > together. Does it seem I missed or misunderstood something? > > I guess so. What other parts of our documentation have you read so > far > to get a more comprehensive picture?
If you want to suggest a reference that is relevant, I would review it, if I have not done so yet. I don't wish to compile a list of documents or sections I have already reviewed.
CG
Hi Eric,
There had been the suggestion that our documentation will provide you more information on how BaseX works. After you have invested more time on the status quo, we might be able to get some progress on this discussion.
Best,
Christian
Quoted text · Eric Levy · 44 lines
On Thu, Mar 3, 2022 at 4:31 PM Eric Levy <contact at ericlevy.name> wrote: > > Hello. I never had a chance to gain a full understanding of the > direction of this discussion. Had there been any suggestion that some > feature enhancement might be considered? I felt the suggestion may have > been given, but it was never resolved. > > > On Fri, 2022-02-25 at 02:37 -0500, Eric Levy wrote: > > > > The base case for an embedded database has no user model, and > > > > supports > > > > creation of new databases only through the target path. However, > > > > such > > > > differences might press the limits of a benign request. > > > > > > > > If a target path is needed beyond the database itself, then it > > > > might be > > > > passed on the command line. Alternatively, a special directory > > > > layout > > > > might be considered […] > > > > > > In both cases, we’d rebuild the existing solution step by step. And > > > if > > > no such path is specified by the user, we’d need to ensure for all > > > operations in the system that nothing unexpected happens. > > > > Sorry, I don't understand the meaning of the comment. > > > > > > > > Yes, but it doesn't mean I understand quite yet how all the parts > > > > fit > > > > together. Does it seem I missed or misunderstood something? > > > > > > I guess so. What other parts of our documentation have you read so > > > far > > > to get a more comprehensive picture? > > > > If you want to suggest a reference that is relevant, I would review > > it, > > if I have not done so yet. I don't wish to compile a list of > > documents > > or sections I have already reviewed. > > >
EL
Hello. I never had a chance to gain a full understanding of the direction of this discussion. Had there been any suggestion that some feature enhancement might be considered? I felt the suggestion may have been given, but it was never resolved.
Quoted text · Eric Levy · 35 lines
On Fri, 2022-02-25 at 02:37 -0500, Eric Levy wrote: > > > The base case for an embedded database has no user model, and > > > supports > > > creation of new databases only through the target path. However, > > > such > > > differences might press the limits of a benign request. > > > > > > If a target path is needed beyond the database itself, then it > > > might be > > > passed on the command line. Alternatively, a special directory > > > layout > > > might be considered […] > > > > In both cases, we’d rebuild the existing solution step by step. And > > if > > no such path is specified by the user, we’d need to ensure for all > > operations in the system that nothing unexpected happens. > > Sorry, I don't understand the meaning of the comment. > > > > > Yes, but it doesn't mean I understand quite yet how all the parts > > > fit > > > together. Does it seem I missed or misunderstood something? > > > > I guess so. What other parts of our documentation have you read so > > far > > to get a more comprehensive picture? > > If you want to suggest a reference that is relevant, I would review > it, > if I have not done so yet. I don't wish to compile a list of > documents > or sections I have already reviewed. >
JR
Eric, I wonder if you are doing something similar to what I am doing.
I have a bunch of databases found in directories, and I currently use paths that look a lot like my directories.
declare variable $gnt:Nestle1904.tei :=
doc("macula/GNT/Nestle1904/tei/nestle1904.xml");
declare variable $gnt:Nestle1904.morph :=
doc("macula/GNT/Nestle1904/morph/Nestle1904.xml");
declare variable $gnt:Nestle1904.lowfat :=
doc("macula/GNT/Nestle1904/lowfat/nestle1904lowfat.xml");If I were writing a function that opened databases in a particular directory, I might pass the "current directory" to that function. I suspect that's an application-domain concept, not something that BaseX should model for your application. After all, someone else might have a rather different notion of a working directory for their application. And "working directory" at the database level would add state in a way that would be actively unhelpful for stateless APIs.
Jonathan
Quoted text · Christian Grün · 58 lines
On Thu, Mar 3, 2022 at 10:39 AM Christian Grün <christian.gruen at gmail.com> wrote: > Hi Eric, > > There had been the suggestion that our documentation will provide you > more information on how BaseX works. After you have invested more time > on the status quo, we might be able to get some progress on this > discussion. > > Best, > Christian > > > On Thu, Mar 3, 2022 at 4:31 PM Eric Levy <contact at ericlevy.name> wrote: > > > > Hello. I never had a chance to gain a full understanding of the > > direction of this discussion. Had there been any suggestion that some > > feature enhancement might be considered? I felt the suggestion may have > > been given, but it was never resolved. > > > > > > On Fri, 2022-02-25 at 02:37 -0500, Eric Levy wrote: > > > > > The base case for an embedded database has no user model, and > > > > > supports > > > > > creation of new databases only through the target path. However, > > > > > such > > > > > differences might press the limits of a benign request. > > > > > > > > > > If a target path is needed beyond the database itself, then it > > > > > might be > > > > > passed on the command line. Alternatively, a special directory > > > > > layout > > > > > might be considered […] > > > > > > > > In both cases, we’d rebuild the existing solution step by step. And > > > > if > > > > no such path is specified by the user, we’d need to ensure for all > > > > operations in the system that nothing unexpected happens. > > > > > > Sorry, I don't understand the meaning of the comment. > > > > > > > > > > > Yes, but it doesn't mean I understand quite yet how all the parts > > > > > fit > > > > > together. Does it seem I missed or misunderstood something? > > > > > > > > I guess so. What other parts of our documentation have you read so > > > > far > > > > to get a more comprehensive picture? > > > > > > If you want to suggest a reference that is relevant, I would review > > > it, > > > if I have not done so yet. I don't wish to compile a list of > > > documents > > > or sections I have already reviewed. > > > > > >
Written for BaseX 9.6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery