dba/databases 
                    library moduleUR
Summary
Delete resources.
- Authors
 - Christian Grün, BaseX Team 2005-23, BSD License
 
Imports
This module is imported by 0 modules. It imports 1 modules.
Variables
Functions
4.1 dba:db-delete
Arities: #2UR
dba:db-delete
		  ( 
			$name as xs:string, $resources as xs:string* ) as empty-sequence- name
asxs:strings database - resources
asxs:string* 
empty-sequenceredirection
Invoked by 0 functions from 0 modules
Annotations (5)
%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 | 
|---|---|
| db | http://basex.org/modules/db | 
| dba | dba/databases 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 
| err | http://www.w3.org/2005/xqt-errors | 
| rest | http://exquery.org/ns/restxq | 
| util | dba/util | 
| xs | http://www.w3.org/2001/XMLSchema | 
Source Code
(:~
 : Delete resources.
 :
 : @author Christian Grün, BaseX Team 2005-23, 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 })
  }
};