dba/queries
library moduleURA
Summary
Evaluate query.
- Authors
- Christian Grün, BaseX Team 2005-23, BSD License
Imports
This module is imported by 0 modules. It imports 1 modules.
Variables
None
Functions
4.1 dba:query-eval
Arities: #1RA
dba:query-eval
(
$query
as
xs:string?
) as
xs:string
- query
as
xs:string?
query
xs:string
result of query
Invoked by 0 functions from 0 modules
Annotations (4)
%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: #1URA
dba:query-update
(
$query
as
xs:string?
) as
empty-sequence
- query
as
xs:string?
query
empty-sequence
result of query
Invoked by 0 functions from 0 modules
Annotations (5)
%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 |
---|---|
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 |
xs | http://www.w3.org/2001/XMLSchema |
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-23, 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)
};