Hello all
I was wondering how to perform database updating, like db:add, in RESTXQ, since the adding and updating functions throw errors when invoked inside functions defined in RESTXQ-modules.
Have been trying to use the forward mechanism, transferring the data to a script without functions, with no success.
Best, Lars G Johnsen
Hi Lars,
are you annotating your RESTXQ endpoints with %updating? F.i.:
declare %rest:path('/somepath') *%updating* function _:update() { updates ... };
Cheers, Lukas
On Tue, Mar 3, 2015 at 10:36 AM, Lars Johnsen yoonsen@gmail.com wrote:
Hello all
I was wondering how to perform database updating, like db:add, in RESTXQ, since the adding and updating functions throw errors when invoked inside functions defined in RESTXQ-modules.
Have been trying to use the forward mechanism, transferring the data to a script without functions, with no success.
Best, Lars G Johnsen
Hi,
it works for me when the XQuery module resides in the "repo" folder, and the RESTXQ function only calls it
---- inside restxq module
import module namespace coll = "http://foo.org/collections";
coll:new("some-db")
---- inside repo module
declare updating function _:new($name as xs:string) { let $foo := "bar/" return db:create($name, concat("/Some/Path/", $foo, $name, ".xml") )
};
2015-03-03 10:36 GMT+01:00 Lars Johnsen yoonsen@gmail.com:
Hello all
I was wondering how to perform database updating, like db:add, in RESTXQ, since the adding and updating functions throw errors when invoked inside functions defined in RESTXQ-modules.
Have been trying to use the forward mechanism, transferring the data to a script without functions, with no success.
Best, Lars G Johnsen
basex-talk@mailman.uni-konstanz.de