restxq and DB access
Tuesday, 15 May 2012 · 2 messages
GC
Gilles CARRY15 May 2012 12:57 #
Hello,
I'm trying to use restxq to generate web report from a DB and I just don't understand where to put the xqueries in the xqm files. Is there any example for this?
In my configuration, I have this URL:
http://httpserverIP:8080/BaseX72/rest/
showing:
<rest:databases resources="2">
<rest:database resources="1" size="3827564582">logs</rest:database> <rest:database resources="1" size="102453817">streams</rest:database> </rest:databases>
And
http://httpserverIP:8080/BaseX72/restxq/
showing the page:
Welcome to the RESTXQ Service
bla...
bla...
But I can't find the way to have an xqm page that queries the above DBs (logs or stream). What shall I do to access data from the xqm files?
It may be so obvious that I can't see it. ;-)
Thanks,
Cheers,
Gilles.
CG
Christian Grün15 May 2012 13:19 #
Dear Gilles,
Quoted text · Gilles CARRY · 2 lines
> I’m trying to use restxq to generate web report from a DB and I just don’t > understand where to put the xqueries in the xqm files.
you can put your queries in any *.xqm file located in the http root directory.
Quoted text · Gilles CARRY · 3 lines
> http://httpserverIP:8080/BaseX72/restxq/ > showing the page: > Welcome to the RESTXQ Service
As you have probably seen, this page also contains some XQuery functions, which you can modify and extend.
Quoted text · Gilles CARRY · 2 lines
> But I can’t find the way to have an xqm page that queries the above DBs > (logs or stream).
Just use db:open(...) inside such a function (in other words, write usual XQuery code, and paste it into the RESTXQ functions).
Hope this helps,
Christian
Written for BaseX 7.2. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery