Client Module

This XQuery Module contains functions to access BaseX server instances from XQuery. With this module, you can execute database commands and evaluate XQuery expressions.

Please note that the client module should always be used to address independent BaseX server instances. You can create deadlocks if you evaluate a query with a server instance, and if you are addressing the same server instance in your query. See the following example:

 (: Retrieve documents from database :) let $client-id := client:connect('localhost', 1984, 'admin', 'admin') let $docs := client:query($client-id, 'db:open("conflict")') (: Create database with same name :) return db:create('conflict', $docs, $docs ! db:path(.))

The read-only query cannot be processed, because the  database is currently write-locked by the main query. See Transaction Management for more background information.

=Conventions=

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

=Functions=

client:close
=Errors=

=Changelog=


 * Version 9.0


 * Updated: error codes updated; errors now use the module namespace


 * Version 8.0


 * Updated: Bound values may now contain no or more than one item in client:query.


 * Version 7.5


 * Added: client:info

The module was introduced with Version 7.3.