Database Module

This XQuery Module contains functions for processing databases from within XQuery. Existing databases can be opened and listed, its contents can be directly accessed, documents can be added to and removed, etc.

=Conventions=

All functions and errors in this module are assigned to the  namespace, which is statically bound to the db prefix.

Database Nodes
Database nodes are XML nodes which are either stored in a persistent database, or which are a node of a main-memory database representation. XML fragments can be converted to a main-memory database by e. g. applying the update or transform expression on a node:

 db:node-id(element hello { 'world' } update {})

=General Functions=

db:backups
=Read Operations=

db:open-pre

 * Support for multiple integers.

db:open-id

 * Support for multiple integers.

db:export
=Value Indexes=

db:token
=Updates=

Important note: All functions in this section are updating functions: they will not be immediately executed, but queued on the Pending Update List, which will be processed after the actual query has been evaluated. This means that the order in which the functions are specified in the query does usually not reflect the order in which the code will be evaluated.

db:add
Allow empty $path argument.

db:flush
=Helper Functions=

db:content-type
=Errors=

=Changelog=


 * Version 9.3


 * Added: db:alter-backup
 * Updated: db:open-id, db:open-pre: support for multiple integers


 * Version 9.2


 * Added: db:dir
 * Updated: db:add: $path allow empty path argument


 * Version 9.0


 * Added: db:option
 * Updated: db:output renamed to $$, db:output-cache renamed to $$
 * Updated: error codes updated; errors now use the module namespace


 * Version 8.6


 * Added: db:property


 * Version 8.4


 * Updated: db:create, db:add, db:replace: support for ADDCACHE option.
 * Added: db:token


 * Version 8.3


 * Updated: db:list-details: attributes with name of database and date of backup added to results.
 * Updated: db:backups now include attributes with name of database and date of backup.
 * Updated: Value Indexes: raise error if no index exists.


 * Version 8.2


 * Added: db:output-cache
 * Removed: db:event


 * Version 7.9


 * Updated: parsing options added to db:create, db:add and db:replace.
 * Updated: allow if $all is true.


 * Version 7.8.2


 * Added: db:alter, db:copy, db:create-backup, db:drop-backup, db:restore


 * Version 7.8


 * Removed: db:fulltext (use ft:search instead)


 * Version 7.7


 * Added: db:export, db:name, db:path
 * Updated: $options argument added to db:create and db:optimize.
 * Updated: the functions no longer accept Database Nodes as reference. Instead, the name of a database must now be specified.


 * Version 7.6


 * Updated: db:create: allow more than one input and path.


 * Version 7.5


 * Updated: db:add: input nodes will be automatically converted to document nodes
 * Added: db:backups
 * Added: db:create
 * Added: db:drop


 * Version 7.3


 * Added: db:flush


 * Version 7.2.1


 * Added: db:text-range, db:attribute-range, db:output


 * Version 7.1


 * Added: db:list-details, db:content-type
 * Updated: db:info, db:system, db:retrieve


 * Version 7.0


 * Added: db:retrieve, db:store, db:exists, db:is-raw, db:is-xml
 * Updated: db:list, db:open, db:add