Changes

Jump to navigation Jump to search
2,313 bytes removed ,  18:39, 1 December 2023
m
Text replacement - "syntaxhighlight" to "pre"
Lines starting with <code>#</code> are interpreted as comments and are skipped. With the following script, a database is created, two documents are added to it, and a query is performed:
<syntaxhighlight pre lang="xml">
CREATE DB test
ADD TO embedded.xml <root>embedded</root>
XQUERY <hits>{ count(//text()) }</hits>
CLOSE
</syntaxhighlightpre>
===XML Syntax===
The XML syntax provides more flexibility here. Multiple commands can be enclosed by a {{Code|<commands/>}} root element. Some commands, such as {{Command|ADD}}, allow you to directly embed XML documents. If you want to embed XML in XQuery expressions, entities should be encoded, or the {{Code|CDATA}} syntax should be used:
<syntaxhighlight pre lang="xml">
<commands>
<create-db name='test'/>
<close/>
</commands>
</syntaxhighlightpre>
==Glob Syntax==
|- valign="top"
| '''Summary'''
|Creates a new database with the specified {{Code|name}} and, optionally, an initial {{Code|input}}, and opens it. An existing database will be overwritten.<br />The input can be a file or directory path to XML documents, a remote URL, or a string containing XML:
* {{Code|name}} must be a [[#Valid Names|valid database name]]
* database creation can be controlled by setting [[Options#Create Options|Create Options]]
==OPEN==
 
{{Announce|Updated with Version 10:}} {{Code|path}} argument dropped.
{| width='100%'
==DIR==
 
{{Announce|Introduced with Version 10.}}
{| width='100%'
=Backups=
 
{{Announce|Introduced with Version 10:}} Support for general data ([[User Management|registered users]], [[Jobs Module#Services|scheduled services]] and [[Store Module|key-value stores]]).
==CREATE BACKUP==
 
{{Announce|Updated with Version 10:}} Support for comments.
{| width='100%'
==GET==
 
{{Announce|Introduced with Version 10.}} The old {{Code|GET}} command has been renamed to {{Command|SHOW OPTIONS}}.
{| width='100%'
==BINARY GET==
 
{{Announce|Updated with Version 10:}} Renamed (before: {{Code|RETRIEVE}}).
{| width='100%'
==PUT==
 
{{Announce|Updated with Version 10:}} Renamed (before: {{Code|REPLACE}}).
{| width='100%'
==BINARY PUT==
 
{{Announce|Updated with Version 10:}} Renamed (before: {{Code|STORE}}).
{| width='100%'
|- valign="top"
| '''Summary'''
|Changes the {{Code|password}} of the current user. If no password the command is specifiedrun on command-line or in the GUI, it is requested via the chosen frontend (GUI or bash)password can be omitted and entered interactively.
|}
==SHOW OPTIONS==
 
{{Announce|Updated with Version 10:}} Renamed (before: {{Code|GET}}).
{| width='100%'
| '''Errors'''
|The command fails if no database is opened, or if one of the specified arguments is invalid.
|}
 
==JOBS LIST==
 
{| width='100%'
|- valign="top"
|width='130'|'''Syntax'''
|{{Code|JOBS LIST}}
|- valign="top"
| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;
|<code><jobs-list/></code><br/>
|- valign="top"
| '''Permission'''
|''ADMIN''
|- valign="top"
| '''Summary'''
|Returns information on all jobs that are currently queued or executed. See {{Function|Job|job:list-details}} for more details on the returned table entries.
|}
 
==JOBS RESULT==
 
{| width='100%'
|- valign="top"
|width='130'|'''Syntax'''
|{{Code|JOBS RESULT [id]}}
|- valign="top"
| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;
|<code><jobs-result id='...'/></code><br/>
|- valign="top"
| '''Permission'''
|''ADMIN''
|- valign="top"
| '''Summary'''
|Returns the cached result of a query with the specified job id:
* Results can only be retrieved once. After retrieval, the cached result will be dropped.
* If the original query has raised an error, the cached error will be raised instead.
|- valign="top"
| '''Errors'''
|The command fails if the addressed job is still running or if the result has already been retrieved.
|}
 
==JOBS STOP==
 
{| width='100%'
|- valign="top"
|width='130'|'''Syntax'''
|{{Code|JOBS STOP [id]}}
|- valign="top"
| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;
|<code><jobs-stop id='...'/></code><br/>
|- valign="top"
| '''Permission'''
|''ADMIN''
|- valign="top"
| '''Summary'''
|Cancels the execution of a job with the specified id, or drops the cached result of a query. Unknown ids are ignored. All jobs are gracefully stopped; it is up to the process to decide when it is safe to shut down.
|}
;Version 10
* Added: [[#Backups|Backups]]: Support for general data ([[User Management|registered users]], [[Jobs Job Module#Services|scheduled services]] and [[Store Module|key-value stores]]).
* Added: {{Command|DIR}}, {{Command|GET}}
* Updated: {{Command|SHOW OPTIONS}}: Renamed (before: {{Code|GET}}).
* Updated: {{Command|CREATE BACKUP}}: Support for comments.
* Updated: {{Command|OPEN}}: {{Code|path}} argument dropped.
* Removed: {{Code|JOBS LIST}}, {{Code|JOBS RESULT}}, {{Code|JOBS STOP}}
;Version 9.7
;Version 7.0
* Added: {{Command|FLUSH}}, {{CommandCode|RETRIEVE}}, {{CommandCode|STORE}}.
* Updated: {{Command|ADD}}: simplified arguments.
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu