dba/databases
library moduleUR
Summary
Delete resources.
- Tags
Author: Christian Grün, BaseX Team 2005-21, BSD License
__source : databases/resources/db-delete.xqm
Imports
This module is imported by 0 modules. It imports 1 modules.
Variables
Functions
4.1 dba:db-delete
Arities: dba:db-delete#2UR
dba:db-delete
(
$name
as
xs:string
, $resources
as
xs:string*
)
as
empty-sequence()
- name
as
xs:string
s database - resources
as
xs:string*
empty-sequence()
redirection
Invokes 3 functions from 2 modules
- util:info#3
- util:redirect#2
- {http://basex.org/modules/db}delete#2
Invoked by 0 functions from 0 modules
Annotations
%updating | () |
%rest:GET | () |
%rest:path | ('/dba/db-delete') |
%rest:query-param | ('name','{$name}') |
%rest:query-param | ('resource','{$resources}') |
Source ( 13 lines)
function dba:db-delete(
$name as xs:string,
$resources as xs:string*
) as empty-sequence() {
try {
$resources ! db:delete($name, .),
util:redirect($dba:SUB,
map { 'name': $name, 'info': util:info($resources, 'resource', 'deleted') }
)
} catch * {
util:redirect($dba:SUB, map { 'name': $name, 'error': $err:description })
}
}
Namespaces
The following namespaces are defined:
Prefix | Uri |
---|---|
ann | http://www.w3.org/2012/xquery |
dba | dba/databases 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
rest | http://exquery.org/ns/restxq |
util | dba/util |
Source Code
(:~
: Delete resources.
:
: @author Christian Grün, BaseX Team 2005-21, BSD License
:)
module namespace dba = 'dba/databases';
import module namespace util = 'dba/util' at '../../lib/util.xqm';
(:~ Sub category :)
declare variable $dba:SUB := 'database';
(:~
: Deletes resources.
: @param $names database
: @param $resource resources
: @return redirection
:)
declare
%updating
%rest:GET
%rest:path('/dba/db-delete')
%rest:query-param('name', '{$name}')
%rest:query-param('resource', '{$resources}')
function dba:db-delete(
$name as xs:string,
$resources as xs:string*
) as empty-sequence() {
try {
$resources ! db:delete($name, .),
util:redirect($dba:SUB,
map { 'name': $name, 'info': util:info($resources, 'resource', 'deleted') }
)
} catch * {
util:redirect($dba:SUB, map { 'name': $name, 'error': $err:description })
}
};