Changes

Jump to navigation Jump to search
1,674 bytes added ,  14:17, 14 October 2011
no edit summary
This page lists all commands that are supported by BaseX.
Commands can be run from the [[Startup_Options#BaseX_Standalone|Command Line]],
the [[Clients]], the [[REST API]], or the input field in the [[GUI_Tutorial|GUI]], orsome other ways.If the GUI is used, all commands that are triggered by the GUI itself
will show up in the [[GUI_Tutorial#Visualizations|Info View]].
The [[User_Management#Command_Permissions|Permission]] fields indicate which
==ADD==
 
<font color='orangered'>Modified in Version 7.0:</font>
 
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>ADD (AS [name]) (TO [targetpath]) [input]</code>
|-
| valign='top' | '''Permission'''
|-
| valign='top' | '''Summary'''
|Adds the files, directory or XML string specified by <code>[input]</code> to the currently opened database, using an optional at the specified <code>[targetpath]</code> path and an optional file .<br/><code>[nameinput]</code>.<br/>The input may either be a single XML document, a directory, a remote URL or a plain XML string. The optional name is ignored if If the input is path denotes a directory, it needs to be suffixed with a slash (<code>/</code>).
|-
| valign='top' | '''Errors'''
|
* <code>ADD input.xml</code><br/>adds the file <code>input.xml</code> to the database.
* <code>ADD AS TO temp/one.xml TO temp input.xml</code><br/>adds <code>input.xml</code> to the database and moves it to <code>temp/one.xml</code>.* <code>ADD TO new target/ xmldir</code><br/>adds all files in from the <code>xmldir</code> source directory to the database and moves them to to in the target directory <code>newtarget</code>path.
|}
|The command fails if no database is opened.
|}
 
==FLUSH==
<font color='orangered'>Introduced with Version 7.0:</font>
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>FLUSH</code>
|-
| valign='top' | '''Permission'''
|''WRITE''
|-
| valign='top' | '''Summary'''
|Explicitly flushes all database buffers to disk. This command is needed if the [[Options (Snapshot)#Database Options|AUTOFLUSH]] option is set to false. (default: <code>true</code>).
|-
| valign='top' | '''Errors'''
|The command fails if no database is opened.
|}
 
==GET==
{|
| valign='top' | '''Errors'''
|The command fails if the specified backup does not exist, if the database to be restored is currently locked, or if it could not be restored for some other reason.
|}
 
==RETRIEVE==
<font color='orangered'>Introduced with Version 7.0:</font>
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>RETRIEVE [path] [input]</code>
|-
| valign='top' | '''Permission'''
|''READ''
|-
| valign='top' | '''Summary'''
|Retrieves raw data from the specified database <code>[path]</code>.
|-
| valign='top' | '''Errors'''
|The command fails if no database is opened, if the source path is invalid or if the data cannot not be retrieved for some other reason.
|}
|The command fails if the optional database could not be opened.
|}
 
==STORE==
<font color='orangered'>Introduced with Version 7.0:</font>
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>STORE (TO [path]) [input]</code>
|-
| valign='top' | '''Permission'''
|''WRITE''
|-
| valign='top' | '''Summary'''
|Stores raw data to the specified <code>[path]</code>. <code>[input]</code> may either be a file reference, a remote URL, or a plain string. If the path denotes a directory, it needs to be suffixed with a slash (<code>/</code>).
|-
| valign='top' | '''Errors'''
|The command fails if no database is opened, if the specified resource is not found, if the target path is invalid or if the data cannot not be written for some other reason.
|}
 
==XQUERY==
{|
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu