On 03/14/2012 08:39 PM, Charles Duffy wrote:
On 03/14/2012 08:08 PM, Christian GrĂ¼n wrote:
-- If you are working more low level, you can directly bind items to the QueryProcessor [1]
...which would be perfect if my usage were embedded. That said, this is actually very compelling -- if only I knew the over-the-wire equivalent to proc.context().
This still remains the first-resort approach, if possible. However...
What's the way you would prefer?
Hopefully something exists already. What I would consider ideal would be an equivalent to ADD (including respecting the PARSER option) which sets the context item rather than storing to the database.
...actually -- if one can bind parameters to a CS command, doing this (with CS able to work without a database) would work as well as a new ADD-equivalent command, while being more flexible -- as all the parsers are available from the XQuery language, they could be invoked from the query given as argument to CS.
That is:
SET BINDINGS $json-string={'foo':'bar'} CS declare $json-string external; json:parse($json-string)
That said, it'd be nice if queries created via the QUERY command could be executed with the context set as their destination rather than having results returned as a string -- an equivalent to EXECUTE which instead puts the output in the context set.