A module for retrieving information about eXist and the system.
system:as-user($username as xs:string, $password as xs:string?, $code-block as item()*) as item()*
A pseudo-function to execute a limited block of code as a different user. The first argument is the name of the user, the second is the password. If the user can be authenticated, the function will execute the code block given in the third argument with the permissions of that user andreturns the result of the execution. Before the function completes, it switches the current user back to the old user.
$username | The username of the user to run the code against |
$password? | The password of the user to run the code against |
$code-block* | The code block to run as the identified user |
system:clear-trace() as item()
Clear the global trace log.
system:clear-xquery-cache() as empty-sequence()
Clear XQuery cache.
system:count-instances-active() as xs:integer
Returns the number of eXist instances that are active.
system:count-instances-available() as xs:integer
Returns the number of eXist instances that are available.
system:count-instances-max() as xs:integer
Returns the maximum number of eXist instances.
system:enable-tracing($enable as xs:boolean) as item()
Enable function tracing on the database instance.
$enable | The boolean flag to enable/disable function tracing |
system:enable-tracing($enable as xs:boolean, $tracelog as xs:boolean) as item()
Enable function tracing on the database instance.
$enable | The enable boolean flag to enable/disable function tracing |
$tracelog | The tracelog boolean flag: if set to true, entering/exiting a function will be logged to the logger 'xquery.profiling' |
system:export($dir as xs:string, $incremental as xs:boolean?, $zip as xs:boolean?) as node()
Export a backup of the database (admin user only).
$dir | This is an absolute path to where the backup will be written. Must be writeable by the eXist process. |
$incremental? | Flag to do incremental export. |
$zip? | Flag to do export to zip file. |
system:export-silently($dir as xs:string, $incremental as xs:boolean?, $zip as xs:boolean?) as xs:boolean
Export a backup of the database (admin user only). Messagers from exporter reroute to logs.
$dir | This is an absolute path to where the backup will be written. Must be writeable by the eXist process. |
$incremental? | Flag to do incremental export. |
$zip? | Flag to do export to zip file. |
system:function-available($function-name as xs:QName, $arity as xs:integer) as xs:boolean
Returns whether a function is available.
$function-name | The fully qualified name of the function |
$arity | The arity of the function |
system:get-build() as xs:string
Returns the build of eXist running this query.
system:get-exist-home() as xs:string
Returns the eXist home location.
system:get-index-statistics() as node()?
Internal function
system:get-memory-free() as xs:long
Returns the amount of free memory available to eXist.
system:get-memory-max() as xs:long
Returns the maximum amount of memory eXist may use.
system:get-memory-total() as xs:long
Returns the total amount of memory in use by eXist.
system:get-module-load-path() as xs:string
Returns the module load path from the current query context. The module load path corresponds to the location on the file system from where modules are loaded into an XQuery. This is usually the directory from which the main XQuery was compiled, or - when executing a stored XQuery - the collection in which the main query resides. The module load path is also used to resolve relative XInclude paths.
system:get-product-name() as xs:string
Returns the product name of the software running this query.
system:get-revision() as xs:string
Returns the Git commit ID of the eXist instance running this query.
system:get-running-jobs() as item()
Get a list of running jobs (dba role only).
system:get-running-xqueries() as item()
Get a list of running XQueries (dba role only).
system:get-scheduled-jobs() as item()
Get a list of scheduled jobs (dba role only).
system:get-uptime() as xs:dayTimeDuration
Returns the time since eXist-db was started. The value is stable over the lifetime of a query.
system:get-version() as xs:string
Returns the version of eXist running this query.
system:import($dir-or-file as xs:string, $admin-pass as xs:string?, $new-admin-pass as xs:string?) as node()
Restore the database or a section of the database (admin user only).
$dir-or-file | This is either a backup directory with the backup descriptor (__contents__.xml) or a backup ZIP file. |
$admin-pass? | The password for the admin user |
$new-admin-pass? | Set the admin password to this new password. |
system:import-silently($dir-or-file as xs:string, $admin-pass as xs:string?, $new-admin-pass as xs:string?) as node()
Restore the database or a section of the database (admin user only). Messagers from exporter reroute to logs.
$dir-or-file | This is either a backup directory with the backup descriptor (__contents__.xml) or a backup ZIP file. |
$admin-pass? | The password for the admin user |
$new-admin-pass? | Set the admin password to this new password. |
system:kill-running-xquery($xquery-id as xs:integer) as item()
Kill a running XQuey (dba role only).
$xquery-id | The XQuery ID obtained from get-running-xqueries() |
system:kill-running-xquery($xquery-id as xs:integer, $wait-time as xs:long) as item()
Kill a running XQuey (dba role only).
$xquery-id | The XQuery ID obtained from get-running-xqueries() |
$wait-time | The wait time in milliseconds before terminating the XQuery |
system:restore($dir-or-file as xs:string, $admin-pass as xs:string?, $new-admin-pass as xs:string?) as node()
Restore the database or a section of the database (admin user only).
$dir-or-file | This is either a backup directory with the backup descriptor (__contents__.xml) or a backup ZIP file. |
$admin-pass? | The password for the admin user |
$new-admin-pass? | Set the admin password to this new password. |
system:restore($dir-or-file as xs:string, $admin-pass as xs:string?, $new-admin-pass as xs:string?, $overwrite as xs:boolean) as node()
Restore the database or a section of the database (admin user only).
$dir-or-file | This is either a backup directory with the backup descriptor (__contents__.xml) or a backup ZIP file. |
$admin-pass? | The password for the admin user |
$new-admin-pass? | Set the admin password to this new password. |
$overwrite | Should newer versions of apps installed in the database be overwritten by those found in the backup? False by default. |
system:shutdown() as item()
Shutdown eXist immediately. This method is only available to the DBA role.
system:shutdown($delay as xs:long) as item()
Shutdown eXist. This method is only available to the DBA role.
$delay | The delay in milliseconds before eXist starts to shutdown. |
system:trace() as node()
Returns function call statistics gathered by the trace log.
system:tracing-enabled() as xs:boolean
Returns true if function tracing is currently enabled on the database instance.
system:trigger-system-task($java-classname as xs:string, $task-parameters as node()?) as item()
Trigger a system task.
$java-classname | The full name of the Java class to execute. It must implement org.exist.storage.SystemTask |
$task-parameters? | The XML fragment with the following structure: <parameters><param name="param-name1" value="param-value1"/></parameters> |
system:update-statistics() as empty-sequence()
This function is part of the unfinished index statistics module, which is not yet usable in a normal eXist setup. update-statistics rebuilds index statistics for the entire database.