dba/queries
library moduleURA
Summary
Evaluate query.
- Tags
Author: Christian Grün, BaseX Team 2005-21, BSD License
__source : queries/query-eval.xqm
Imports
This module is imported by 0 modules. It imports 1 modules.
Variables
None
Functions
4.1 dba:query-eval
Arities: dba:query-eval#1RA
dba:query-eval
(
$query
as
xs:string?
)
as
xs:string
- query
as
xs:string?
query
xs:string
result of query
Invokes 1 functions from 1 modules
Invoked by 0 functions from 0 modules
Annotations
%rest:POST | ('{$query}') |
%rest:path | ('/dba/query-eval') |
%rest:single | () |
%output:method | ('text') |
Source ( 5 lines)
function dba:query-eval(
$query as xs:string?
) as xs:string {
util:query($query, ())
}
4.2 dba:query-update
Arities: dba:query-update#1URA
dba:query-update
(
$query
as
xs:string?
)
as
empty-sequence()
- query
as
xs:string?
query
empty-sequence()
result of query
Invokes 1 functions from 1 modules
Invoked by 0 functions from 0 modules
Annotations
%updating | () |
%rest:POST | ('{$query}') |
%rest:path | ('/dba/query-update') |
%rest:single | () |
%output:method | ('text') |
Source ( 5 lines)
function dba:query-update(
$query as xs:string?
) as empty-sequence() {
util:update-query($query)
}
Namespaces
The following namespaces are defined:
Prefix | Uri |
---|---|
ann | http://www.w3.org/2012/xquery |
dba | dba/queries 2 3 4 5 |
output | http://www.w3.org/2010/xslt-xquery-serialization |
rest | http://exquery.org/ns/restxq |
util | dba/util |
6 RestXQ
Paths defined 2.
Path | Method | Function |
---|---|---|
/dba/query-eval | POST | dba:query-eval#1 |
/dba/query-update | POST | dba:query-update#1 |
Source Code
(:~
: Evaluate query.
:
: @author Christian Grün, BaseX Team 2005-21, BSD License
:)
module namespace dba = 'dba/queries';
import module namespace util = 'dba/util' at '../lib/util.xqm';
(:~
: Evaluates a query and returns the result.
: @param $query query
: @return result of query
:)
declare
%rest:POST('{$query}')
%rest:path('/dba/query-eval')
%rest:single
%output:method('text')
function dba:query-eval(
$query as xs:string?
) as xs:string {
util:query($query, ())
};
(:~
: Runs an updating query.
: @param $query query
: @return result of query
:)
declare
%updating
%rest:POST('{$query}')
%rest:path('/dba/query-update')
%rest:single
%output:method('text')
function dba:query-update(
$query as xs:string?
) as empty-sequence() {
util:update-query($query)
};