basexclient and modules
Tuesday, 21 July 2015 · 3 messages · last reply 23 Jul 2015
C
cmarchand21 Jul 2015 14:30 #
Hello !
we would like to execute thru basexclient a xquery script that includes a xquery module :
xquery encoding "utf-8";
declare namespace db="http://basex.org/modules/db";
import module namespace
om-ll='http://els.eu/ns/efl/offresMetiers/CreateCIActu/lowLevel' at
'lowLevel.xqm';With basexgui and basex CLI, no problem. But with basexclient, it seems included files are not send to server, so server can not resolve dependencies, and compile xquery.
I can understand that compilation must be done on server-side - well, at least optimization - but client could parse the .xq file to check if there are imports, and either push them to server, or throw an error without accessing the server.
Is this an issue ?
Is there an utility-tool which allows to generates a single script file from a .xq and included .xqm, that I could use before running basexclient ?
Best regards,
Christophe
CG
Christian Grün22 Jul 2015 15:08 #
Hi Christophe,
Quoted text · cmarchand · 4 lines
> I can understand that compilation must be done on server-side - well, at > least optimization - but client could parse the .xq file to check if there > are imports, and either push them to server, or throw an error without > accessing the server.
Raising errors sounds dangerous to me: I remember at least two use cases in which it was a deliberate choice to send XQuery code with module imports to a BaseX server. Moreover, besides module imports, there are numerous other expressions in a query module – such as the doc() function – which may be interpretedly differently on a client and on a server.
Quoted text · cmarchand · 2 lines
> Is there an utility-tool which allows to generates a single script file from > a .xq and included .xqm, that I could use before running basexclient ?
Maybe you can simply move all your library modules into the
server-side BaseX repository. In this case, you won't need to specify the module location anymore [1].
Hope this helps,
Christian
[1] http://docs.basex.org/wiki/Repository#Accessing_Modules
Quoted text · cmarchand · 6 lines
> > > > Best regards, > > Christophe
C
cmarchand23 Jul 2015 08:51 #
Moving our xquery modules into server repository isn't a solution, as we could have many releases of the same module, used on various databases.
So the solution will be to build a single .xq file with all the code in.
I'm going to write a maven plugin to do this. Is there some basex code I could use to help me ? Entries will help !
Thanks in advance,
Christophe
Quoted text · Christian Grün · 30 lines
Le 2015-07-22 15:08, Christian Grün a écrit : > Hi Christophe, > >> I can understand that compilation must be done on server-side - well, at >> least optimization - but client could parse the .xq file to check if there >> are imports, and either push them to server, or throw an error without >> accessing the server. > > Raising errors sounds dangerous to me: I remember at least two use > cases in which it was a deliberate choice to send XQuery code with > module imports to a BaseX server. Moreover, besides module imports, > there are numerous other expressions in a query module - such as the > doc() function - which may be interpretedly differently on a client > and on a server. > >> Is there an utility-tool which allows to generates a single script file from >> a .xq and included .xqm, that I could use before running basexclient ? > > Maybe you can simply move all your library modules into the > server-side BaseX repository. In this case, you won't need to specify > the module location anymore [1 [1]]. > > Hope this helps, > Christian > > [1] http://docs.basex.org/wiki/Repository#Accessing_Modules [1] > >> Best regards, >> >> Christophe
Links:
------
[1] http://docs.basex.org/wiki/Repository#Accessing_Modules
Written for BaseX 8.2. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery