Changes

Jump to navigation Jump to search
132 bytes added ,  16:57, 6 April 2012
Both database and user names must follow the same naming constraints. Valid names may contain letters, numbers, underscores and dashes. Names must have at least one character; they also should not be longer than 128 characters, although this is not enforced. A regular expression matching valid names is <code>[-_a-zA-Z0-9]{1,128}</code>.
=CommandsDatabase Operations=
==ADDCREATE DATABASE==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>ADD (TO CREATE DATABASE [pathname]) ([input]</code>|-| valign='top' | '''Permission'''|''WRITE''|-| valign='top' | '''Summary'''|Adds the files, directory or XML string specified by <code>[input]</code> to the currently opened database at the specified <code>[path]</code>.<br/><code>[input]</code> may either be a single XML document, a directory, a remote URL or a plain XML 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 one of the documents to be added is not well-formed, or if it could not be parsed for some other reason.|-| valign='top' | '''Examples'''|* <code>ADD input.xml</code><br/>adds the file <code>input.xml</code> to the database.* <code>ADD TO temp/one.xml input.xml</code><br/>adds <code>input.xml</code> to the database and moves it to <code>temp/one.xml</code>.* <code>ADD TO target/ xmldir</code><br/>adds all files from the <code>xmldir</code> directory to the database in the <code>target</code> path.|} ==ALTER DATABASE=={||-| valign='top' width='90' | '''Signature'''|<code>ALTER DATABASE [name] [newname]</code>
|-
| valign='top' | '''Permission'''
|-
| valign='top' | '''Summary'''
|Renames Creates the database specified by <code>[name]</code> to with an optional <code>[newnameinput]</code>.<br />The input may either be a single XML document, a directory, a remote URL or a plain XML string. <code>[newnamename]</code> must be a [[Valid Names|valid database name]].
|-
| valign='top' | '''Errors'''
|The command fails if the target a database already exists, if with the source database does not exist or specified name is currently lockedused by another process, or if it one of the documents to be added is not well-formed or could not be renamed parsed for some other reason.
|-
| valign='top' | '''Examples'''
|
* <code>ALTER CREATE DATABASE db tempdbinput</code><br/>renames creates an empty database <code>input</code>.* <code>CREATE DATABASE xmark http://files.basex.org/xml/xmark.xml</code><br/>creates the database <code>dbinput</code> into with the remote file xmark.xml as initial content.* <code>CREATE DATABASE coll /path/to/input</code><br/>creates the database <code>coll</code> with all documents from the <code>input</code> directory as initial content.* <code>SET INTPARSE false;CREATE DB input input.xml</code><br/>creates a database <code>tempdbinput</code>, using Java's [[Parsers#XML Parsers|default XML parser]].
|}
==ALTER USEROPEN==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>ALTER USER OPEN [namepath] ([password])</code>
|-
| valign='top' | '''Permission'''
|''ADMINREAD''
|-
| valign='top' | '''Summary'''
|Alters Opens the documents in a database. <code>[passwordpath]</code> is the name of the user specified database, optionally followed by <code>[name]</code>. The password must be a valid MD5 hash value. If no password is specified in path to the console mode, it is requested via standard inputdocuments.
|-
| valign='top' | '''Errors'''
|The command fails if the specified user does not exist, or if the password is no valid MD5 hash valuedatabase cannot be opened for some unknown reason.
|}
|}
==COPYEXPORT==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>COPY EXPORT [name] [newnamepath]</code>
|-
| valign='top' | '''Permission'''
|-
| valign='top' | '''Summary'''
|Creates a copy of Exports all documents in the database to the specified by <code>[namepath]</code>. , using the serializer options specified by the <code>[newname[Options#EXPORTER|EXPORTER]]</code> must be a [[Valid Names|valid database name]]option.
|-
| valign='top' | '''Errors'''
|The command fails if the target no database already existsis opened, or if the source database does not exist.|}==CREATE BACKUP=={||-| valign='top' width='90' | '''Signature'''|<code>CREATE BACKUP [name]</code>|-| valign='top' | '''Permission'''|''CREATE''|-| valign='top' | '''Summary'''|Creates target path points to a zipped backup of the database specified by {{Mono|[name]}}. The backup file will be suffixed with the current timestamp and stored in the database directory. The Glob syntax can be used to address more than one database.|-| valign='top' | '''Errors'''|The command fails or is invalid, if the specified database does not existserialization parameters are invalid, or if it could not the documents cannot be zipped serialized for some other reason.|-| valign='top' | '''Examples'''|* <code>BACKUP db</code><br/>creates a zip archive of the database <code>db</code> (e.g. <code>db-2011-04-01-12-27-28.zip</code>) in your [[Configuration#Database_Directory|database directory]].
|}
==CREATE DATABASEINDEX== {{Mark|Updated in Version 7.2:}} {{Mono|PATH}} removed as argument; path summary is now updated by [[#OPTIMIZE|OPTIMIZE]] command
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>CREATE DATABASE INDEX [nameTEXT&#124;ATTRIBUTE&#124;FULLTEXT] ([input])</code>
|-
| valign='top' | '''Permission'''
|''CREATEWRITE''
|-
| valign='top' | '''Summary'''
|Creates the specified database <code>[name]</code> with an optional <code>[input]</code>.<br />The input may either be a single XML document, a directory, a remote URL or a plain XML string. <code>[name]</code> must be a [[Valid NamesIndexes|valid database nameindex]].
|-
| valign='top' | '''Errors'''
|The command fails if a no database with is opened, if the specified name index is currently used by another processunknown, or if one of the documents to be added is not well-formed or could not be parsed indexing fails for some other reason.|-| valign='top' | '''Examples'''|* <code>CREATE DATABASE input</code><br/>creates an empty database <code>input</code>.* <code>CREATE DATABASE xmark http://files.basex.org/xml/xmark.xml</code><br/>creates the database <code>input</code> with the remote file xmark.xml as initial content.* <code>CREATE DATABASE coll /path/to/input</code><br/>creates the database <code>coll</code> with all documents from the <code>input</code> directory as initial content.* <code>SET INTPARSE false;CREATE DB input input.xml</code><br/>creates a database <code>input</code>, using Java's [[Parsers#XML Parsers|default XML parser]].
|}
==CREATE DROP INDEX==
{{Mark|Updated in Version 7.2:}} {{Mono|PATH}} removed as argument; path summary is now updated by [[#OPTIMIZE|OPTIMIZE]] commandalways available
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>CREATE DROP INDEX [TEXT&#124;ATTRIBUTE&#124;FULLTEXT]</code>
|-
| valign='top' | '''Permission'''
|-
| valign='top' | '''Summary'''
|Creates Drops the specified database [[Indexes|index]].
|-
| valign='top' | '''Errors'''
|The command fails if no database is opened, if the specified index is unknown, or if indexing fails it could not be deleted for some other reason.
|}
=Administration=CREATE EVENT ==ALTER DATABASE==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>CREATE EVENT ALTER DATABASE [NAMEname] [newname]</code>
|-
| valign='top' | '''Permission'''
|''ADMINCREATE''
|-
| valign='top' | '''Summary'''
|Creates Renames the database specified by <code>[name]</code> to <code>[Eventsnewname]</code>. <code>[newname]</code> must be a [[Valid Names|eventvalid database name]].
|-
| valign='top' | '''Errors'''
|The command fails if event the target database already exists, if the source database does not exist or is currently locked, or if it could not be renamed for some other reason.|-| valign='top' | '''Examples'''|* <code>ALTER DATABASE db tempdb</code><br/>renames the database <code>db</code> into <code>tempdb</code>.
|}
==CREATE USERDROP DATABASE==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>CREATE USER DROP DATABASE [name] ([password])</code>
|-
| valign='top' | '''Permission'''
|''ADMINCREATE''
|-
| valign='top' | '''Summary'''
|Creates a user Drops the database with the specified <code>[name]</code> and <code>[password]</code>. <code>[name]</code> must be a [[Valid Names|valid user name]]. The password must Glob syntax can be a valid MD5 hash value. If no password is specified in the console mode, it is requested via standard inputused to address more than one database.
|-
| valign='top' | '''Errors'''
|The command fails if the specified user already existsdatabase does not exist or is currently locked, or if the password is no valid MD5 hash valuedatabase could not be deleted for some other reason.
|}
==CSCREATE BACKUP==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>CS CREATE BACKUP [queryname]</code>
|-
| valign='top' | '''Permission'''
|''depends on queryCREATE''
|-
| valign='top' | '''Summary'''
|Evaluates Creates a zipped backup of the database specified <code>by {{Mono|[queryname]</code> }}. The backup file will be suffixed with the current timestamp and sets stored in the result as new context setdatabase directory. The Glob syntax can be used to address more than one database.
|-
| valign='top' | '''Errors'''
|The command fails if no the specified database is openeddoes not exist, if the specified query is invalid or if it does could not return nodes be zipped for some other reason.|-| valign='top' | '''Examples'''|* <code>BACKUP db</code><br/>creates a zip archive of the currently opened database<code>db</code> (e.g. <code>db-2011-04-01-12-27-28.zip</code>) in your [[Configuration#Database_Directory|database directory]].
|}
 ==DELETERESTORE==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>DELETE RESTORE [pathname]</code>
|-
| valign='top' | '''Permission'''
|''WRITECREATE''
|-
| valign='top' | '''Summary'''
|Deletes all documents from the currently opened Restores a database that start with the specified <code>[pathname]</code>. The name may include the timestamp of the backup file.
|-
| valign='top' | '''Errors'''
|The command fails if no the specified backup does not exist, if the database to be restored is openedcurrently locked, or if it could not be restored for some other reason.
|}
 
==DROP BACKUP==
{|
|}
==DROP DATABASECOPY==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>DROP DATABASE COPY [name] [newname]</code>
|-
| valign='top' | '''Permission'''
|-
| valign='top' | '''Summary'''
|Drops Creates a copy of the database with the specified by <code>[name]</code>. The Glob syntax can <code>[newname]</code> must be used to address more than one a [[Valid Names|valid databasename]].
|-
| valign='top' | '''Errors'''
|The command fails if the specified target database does not exist or is currently lockedalready exists, or if the source database could does not be deleted for some other reasonexist.
|}
==DROP EVENTINFO DATABASE==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>DROP EVENT [NAME]INFO DATABASE</code>
|-
| valign='top' | '''Permission'''
|''ADMINREAD''
|-
| valign='top' | '''Summary'''
|Drops Shows information on the specified [[Events|event]]currently opened database.
|-
| valign='top' | '''Errors'''
|The command fails if the event doesn't existno database is opened.
|}
==DROP INFO INDEX== {{Mark|Updated in Version 7.2:}} {{Mono|PATH}} removed as argument; path summary is now always available
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>DROP INFO INDEX ([TEXT&#124;ATTRIBUTE&#124;FULLTEXT&#124;PATH])</code>
|-
| valign='top' | '''Permission'''
|''WRITEREAD''
|-
| valign='top' | '''Summary'''
|Drops Shows information on the specified database existing [[Indexes|index]]structures. The output can be optionally limited to the specified index.
|-
| valign='top' | '''Errors'''
|The command fails if no database is opened, or if the specified index is unknown, or if it could not be deleted for some other reason.
|}
==DROP USERINFO STORAGE==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>DROP USER INFO STORAGE [namestart end] (ON &#124; [databasequery])</code>:
|-
| valign='top' | '''Permission'''
|''ADMINREAD''
|-
| valign='top' | '''Summary'''
|Drops Shows the user with internal main table of the specified <code>[name]</code>currently opened database. If An integer range or a <code>[database]</code> is query may be specified, the user is only dropped locally. The Glob syntax can be used to address more than one database or useras argument.
|-
| valign='top' | '''Errors'''
|The command fails if <code>admin</code> no database is specified as user nameopened, or if one of the specified user does not exist or arguments is logged in, or if the optional database could not be opened for modificationinvalid.
|}
 =Querying =EXIT ==LIST==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>EXIT LIST ([path])</code>
|-
| valign='top' | '''Permission'''
|-
| valign='top' | '''Summary'''
|Exits Lists all available databases, or the console modedocuments in a database. <code>[path]</code> is the name of the database, optionally followed by a path to the requested documents.|-| valign='top' | '''Errors'''|The command fails if the optional database cannot be opened, or if the existing databases cannot be listed for some other reason.
|}
 ==EXPORTXQUERY==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>EXPORT XQUERY [pathquery]</code>
|-
| valign='top' | '''Permission'''
|''CREATEdepends on query''
|-
| valign='top' | '''Summary'''
|Exports all documents in the database to Runs the specified <code>[pathquery]</code>, using the serializer options specified by and prints the <code>[[Options#EXPORTER|EXPORTER]]</code> optionresult.
|-
| valign='top' | '''Errors'''
|The command fails if no database is opened, if the target path points to a file or specified query is invalid.|-| valign='top' | '''Examples'''|* <code>XQUERY 1 to 10</code><br/>returns the sequence <code>(1, 2, if 3, 4, 5, 6, 7, 8, 9, 10)</code>.* <code>SET RUNS 10;XQUERY 1 to 10</code><br/>runs the serialization parameters are invalidquery 10 times, or if returns the result and prints the average execution time.* <code>SET XMLPLAN true;XQUERY 1 to 10</code><br/>returns the result and prints the documents cannot be serialized for some other reasonquery plan as XML.
|}
==FINDRETRIEVE==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>FIND RETRIEVE [keywordspath] [input]</code>
|-
| valign='top' | '''Permission'''
|-
| valign='top' | '''Summary'''
|Builds and runs a query for Retrieves raw data from the specified database <code>[keywordspath]</code>. Keywords can be enclosed in quotes to look for phrases. The following modifiers can be used to further limit search:<code>= </code> looks for exact text nodes<br/><code>~ </code> looks for approximate hits<br/><code>@=</code> looks for exact attribute values<br/><code>@ </code> looks for attributes
|-
| 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.
|}
==FLUSHRUN==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>FLUSHRUN [file]</code>
|-
| valign='top' | '''Permission'''
|''WRITEdepends on query''
|-
| valign='top' | '''Summary'''
|Explicitly flushes the buffers of the currently opened database to disk. This command is applied if Runs the query contained in <code>[[Options#AUTOFLUSH|AUTOFLUSHfile]] option has been set to false</code> and prints the result.
|-
| valign='top' | '''Errors'''
|The command fails if no database the specified file does not exist, or if the retrieved query is openedinvalid.
|}
==GETFIND==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>GET FIND [optionkeywords]</code>
|-
| valign='top' | '''Permission'''
|-
| valign='top' | '''Summary'''
|Returns Builds and runs a query for the current value of the [[Options|Option]] specified via {{Mono|<code>[keykeywords]}}</code>. Keywords can be enclosed in quotes to look for phrases.The following modifiers can be used to further limit search:<code>= </code> looks for exact text nodes<br/><code>~ </code> looks for approximate hits<br/><code>@=</code> looks for exact attribute values<br/><code>@ </code> looks for attributes
|-
| valign='top' | '''Errors'''
|The command fails if the specified option no database is unknownopened.
|}
==GRANTCS==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>GRANT CS [NONE&#124;READ&#124;WRITE&#124;CREATE&#124;ADMIN] (ON [database]) TO [userquery]</code>
|-
| valign='top' | '''Permission'''
|''ADMINdepends on query''
|-
| valign='top' | '''Summary'''
|Grants Evaluates the specified [[User_Management|permission]] to the specified <code>[user]</code>. If a <code>[databasequery]</code> is specified, and sets the permissions are only granted locally. The Glob syntax can be used to address more than one database or userresult as new context set.
|-
| valign='top' | '''Errors'''
|The command fails if <code>admin</code> no database is specified as user nameopened, if the specified user query is invalid or if it does not exist, or if return nodes of the optional database could not be currently opened for modification.|-| valign='top' | '''Examples'''|* <code>GRANT READ TO JoeWinson</code><br/>grants <code>READ</code> permission to the user <code>JoeWinson</code>.* <code>GRANT WRITE ON Wiki TO editor*</code><br/>grants <code>WRITE</code> permissions on the <code>Wiki</code> database to all users starting with the characters <code>editor*</code>.
|}
==HELPREPO INSTALL==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>HELP (REPO INSTALL [commandpath])</code>
|-
| valign='top' | '''Permission'''
|''NONECREATE''({{Mark|before Version 7.2}}: ''ADMIN'')
|-
| valign='top' | '''Summary'''
|If Installs the package with path <code>[commandpath]</code> is specified, information on the specific command is printed; otherwise, all commands are listed.
|-
| valign='top' | '''Errors'''
|The command fails if in the specified command following cases:* The package to be installed is unknownnot a xar file.* The package to be installed does not exist or is already installed.* The package descriptor is with invalid syntax.* The package to be installed depends on a package which is not installed.* The package is not supported by the current version of BaseX.* A component of the package is already installed as part of another package.
|}
 ==INFOREPO LIST==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>INFOREPO LIST</code>
|-
| valign='top' | '''Permission'''
|''READ''({{Mark|before Version 7.2}}: ''ADMIN'')
|-
| valign='top' | '''Summary'''
|Shows global informationLists all installed packages.
|}
 ==INFO DATABASEREPO DELETE==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>INFO DATABASEREPO DELETE [name&#124;dir]</code>
|-
| valign='top' | '''Permission'''
|''READCREATE''({{Mark|before Version 7.2}}: ''ADMIN'')
|-
| valign='top' | '''Summary'''
|Shows information on Deletes the currently opened databasepackage with name <code>[name]</code> or with directory <code>[dir]</code>.
|-
| valign='top' | '''Errors'''
|The command fails if no database is openedthe package to be deleted participates in a dependency.
|}
 =Updates=INFO INDEX ==ADD==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>INFO INDEX ADD (TO [TEXT&#124;ATTRIBUTE&#124;FULLTEXT&#124;PATHpath])[input]</code>
|-
| valign='top' | '''Permission'''
|''READWRITE''
|-
| valign='top' | '''Summary'''
|Shows information on Adds the existing files, directory or XML string specified by <code>[input]</code> to the currently opened database at the specified <code>[Indexes|indexpath]</code>.<br/><code>[input] structures</code> may either be a single XML document, a directory, a remote URL or a plain XML string. The output can If the path denotes a directory, it needs to be optionally limited to the specified indexsuffixed with a slash (<code>/</code>).
|-
| valign='top' | '''Errors'''
|The command fails if no database is opened, if one of the documents to be added is not well-formed, or if it could not be parsed for some other reason.|-| valign='top' | '''Examples'''|* <code>ADD input.xml</code><br/>adds the specified index is unknownfile <code>input.xml</code> to the database.* <code>ADD TO temp/one.xml input.xml</code><br/>adds <code>input.xml</code> to the database and moves it to <code>temp/one.xml</code>.* <code>ADD TO target/ xmldir</code><br/>adds all files from the <code>xmldir</code> directory to the database in the <code>target</code> path.
|}
==INFO STORAGEDELETE==
{|
|-
| valign='top' width='90' | '''Signature'''
| <code>INFO STORAGE DELETE [start end] &#124; [querypath]</code>
|-
| valign='top' | '''Permission'''
|''READWRITE''
|-
| valign='top' | '''Summary'''
|Shows the internal main table of Deletes all documents from the currently opened database. An integer range or a query may be that start with the specified as argument<code>[path]</code>.
|-
| valign='top' | '''Errors'''
|The command fails if no database is opened, or if one of the specified arguments is invalid.
|}
 ==KILLRENAME==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>KILL RENAME [targetpath] [newpath]</code>
|-
| valign='top' | '''Permission'''
|''ADMINWRITE''
|-
| valign='top' | '''Summary'''
|Kills sessions of a user or an IP:port combination, Renames all document paths in the currently opened database that start with the specified by <code>[targetpath]</code>. The Glob syntax can command may be used to address more than one usereither rename single documents or directories.
|-
| valign='top' | '''Errors'''
|The command fails if no database is opened, or if the target path is empty.|-| valign='top' | '''Examples'''|* <code>RENAME one.xml two.xml</code><br/>renames the document <code>one.xml</code> to <code>two.xml</code>.* <code>RENAME / TOP</code><br/>moves all documents to a user tried to kill his<code>TOP</her own sessioncode> root directory.
|}
==LISTREPLACE==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>LIST (REPLACE [path])[input]</code>
|-
| valign='top' | '''Permission'''
|''NONEWRITE''
|-
| valign='top' | '''Summary'''
|Lists all available databases, or Replaces the documents in a the currently opened database. , addressed by <code>[path]</code> is , with the file or XML string specified by <code>[input]</code>. The original file name of the database, optionally followed and path is preserved by a path to the requested documentsoperation.
|-
| valign='top' | '''Errors'''
|The command fails if no database is opened, if the optional specified path points to a database cannot be openeddirectory, or if the existing databases cannot be listed for some other reasoninput is not found.|-| valign='top' | '''Examples'''|* <code>REPLACE one.xml input.xml</code><br/>replaces the document <code>one.xml</code> with the contents of the file <code>input.xml</code>.* <code>REPLACE top.xml &lt;xml/&gt;</code><br/>replaces the document <code>top.xml</code> with the document <code>&lt;xml/&gt;</code>.
|}
 ==OPENSTORE==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>OPEN STORE (TO [path]) [input]</code>
|-
| valign='top' | '''Permission'''
|''READWRITE''
|-
| valign='top' | '''Summary'''
|Opens Stores raw data to the documents in a databasespecified <code>[path]</code>. <code>[pathinput]</code> is the name of the databasemay either be a file reference, a remote URL, optionally followed by or a plain string. If the path denotes a directory, it needs to the requested documentsbe suffixed with a slash (<code>/</code>).
|-
| valign='top' | '''Errors'''
|The command fails if no database is opened, if the specified database resource is not found, if the target path is invalid or if the data cannot not be opened written for some unknown other reason.
|}
 
==OPTIMIZE==
{|
|}
==PASSWORDFLUSH==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>PASSWORD ([password])FLUSH</code>
|-
| valign='top' | '''Permission'''
|''NONEWRITE''
|-
| valign='top' | '''Summary'''
|Changes Explicitly flushes the <code>[password]</code> buffers of the current user. The password must be a valid MD5 hash valuecurrently opened database to disk. If no password This command is specified in applied if the console mode, it is requested via standard input[[Options#AUTOFLUSH|AUTOFLUSH]] option has been set to false.
|-
| valign='top' | '''Errors'''
|The command fails if the password no database is no valid MD5 hash valueopened.|} =Server Administration= ==SHOW BACKUPS=={||-| valign='top' width='90' | '''Signature'''|<code>SHOW BACKUPS</code>|-| valign='top' | '''Permission'''|''CREATE''|-| valign='top' | '''Summary'''|Shows all database backups.
|}
==RENAMESHOW DATABASES==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>RENAME [path] [newpath]SHOW DATABASES</code>
|-
| valign='top' | '''Permission'''
|''WRITEADMIN''
|-
| valign='top' | '''Summary'''
|Renames Shows all document paths databases that are opened in the currently opened database that start with the specified current server instance.|} ==SHOW SESSIONS=={||-| valign='top' width='90' | '''Signature'''|<code>[path]SHOW SESSIONS</code>. The command may be used to either rename single documents or directories.
|-
| valign='top' | '''ErrorsPermission'''|The command fails if no database is opened, or if the target path is empty.''ADMIN''
|-
| valign='top' | '''ExamplesSummary'''|* <code>RENAME one.xml two.xml</code><br/>renames the document <code>one.xml</code> to <code>two.xml</code>.* <code>RENAME / TOP</code><br/>moves Shows all documents sessions that are connected to a <code>TOP</code> root directorythe current server instance.
|}
==REPLACESHOW USERS==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>REPLACE SHOW USERS (ON [path] [inputdatabase])</code>
|-
| valign='top' | '''Permission'''
|''WRITEADMIN''
|-
| valign='top' | '''Summary'''
|Replaces the documents Shows all users that are registered in the currently opened database, addressed by . If a <code>[pathdatabase]</code>is specified, with the file or XML string specified by <code>[input]</code>. The original file name and path is preserved by the operationlocal users are shown.
|-
| valign='top' | '''Errors'''
|The command fails if no database is opened, if the specified path points to a optional database directory, or if the input is could not found.|-| valign='top' | '''Examples'''|* <code>REPLACE one.xml input.xml</code><br/>replaces the document <code>one.xml</code> with the contents of the file <code>input.xml</code>.* <code>REPLACE top.xml &lt;xml/&gt;</code><br/>replaces the document <code>top.xml</code> with the document <code>&lt;xml/&gt;</code>be opened.
|}
==REPO DELETEKILL==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>REPO DELETE KILL [name&#124;dirtarget]</code>
|-
| valign='top' | '''Permission'''
|''CREATE'' ({{Mark|before Version 7.2}}: ''ADMIN'')
|-
| valign='top' | '''Summary'''
| Deletes the package with name <code>[name]</code> Kills sessions of a user or with directory an IP:port combination, specified by <code>[dirtarget]</code>. The Glob syntax can be used to address more than one user.
|-
| valign='top' | '''Errors'''
| The command fails if the package a user tried to be deleted participates in a dependencykill his/her own session.
|}
==REPO INSTALLCREATE EVENT==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>REPO INSTALL CREATE EVENT [pathNAME]</code>
|-
| valign='top' | '''Permission'''
|''CREATE'' ({{Mark|before Version 7.2}}: ''ADMIN'')
|-
| valign='top' | '''Summary'''
| Installs Creates the package with path <code>specified [path[Events|event]]</code>.
|-
| valign='top' | '''Errors'''
| The command fails in the following cases:* The package to be installed is not a xar file.* The package to be installed does not exist or is if event already installed.* The package descriptor is with invalid syntax.* The package to be installed depends on a package which is not installed.* The package is not supported by the current version of BaseX.* A component of the package is already installed as part of another packageexists.
|}
==REPO LISTSHOW EVENTS==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>REPO LISTSHOW EVENTS</code>
|-
| valign='top' | '''Permission'''
|''READ'' ({{Mark|before Version 7.2}}: ''ADMIN'')
|-
| valign='top' | '''Summary'''
| Lists Shows all installed packages[[Events|events]] that have been registered in the database.
|}
==RESTOREDROP EVENT==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>RESTORE DROP EVENT [nameNAME]</code>
|-
| valign='top' | '''Permission'''
|''CREATEADMIN''
|-
| valign='top' | '''Summary'''
|Restores a database with Drops the specified <code>[name[Events|event]]</code>. The name may include the timestamp of the backup file.
|-
| valign='top' | '''Errors'''
|The command fails if the specified backup does not event doesn't exist, if the database to be restored is currently locked, or if it could not be restored for some other reason.
|}
=User Management=RETRIEVE ==CREATE USER==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>RETRIEVE CREATE USER [pathname] ([inputpassword])</code>
|-
| valign='top' | '''Permission'''
|''READADMIN''
|-
| valign='top' | '''Summary'''
|Retrieves raw data from Creates a user with the specified database <code>[pathname]</code>and <code>[password]</code>. <code>[name]</code> must be a [[Valid Names|valid user name]]. The password must be a valid MD5 hash value. If no password is specified in the console mode, it is requested via standard input.
|-
| valign='top' | '''Errors'''
|The command fails if no database is openedthe specified user already exists, or if the source path password is invalid or if the data cannot not be retrieved for some other reasonno valid MD5 hash value.
|}
==RUNALTER USER==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>RUN ALTER USER [filename]([password])</code>
|-
| valign='top' | '''Permission'''
|''depends on queryADMIN''
|-
| valign='top' | '''Summary'''
|Runs Alters the query contained in <code>[filepassword]</code> of the user specified by <code>[name]</code> and prints . The password must be a valid MD5 hash value. If no password is specified in the resultconsole mode, it is requested via standard input.
|-
| valign='top' | '''Errors'''
|The command fails if the specified file user does not exist, or if the retrieved query password is invalidno valid MD5 hash value.
|}
==SETDROP USER==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>SET DROP USER [optionname] (ON [valuedatabase])</code>:
|-
| valign='top' | '''Permission'''
|''READADMIN''
|-
| valign='top' | '''Summary'''
|Sets Drops the [[Options|Option]] user with the specified <code>[keyname]</code> to . If a new <code>[valuedatabase]</code>. If no value is specified, and if the value user is boolean, it will only dropped locally. The Glob syntax can be invertedused to address more than one database or user.
|-
| valign='top' | '''Errors'''
|The command fails if <code>admin</code> is specified as user name, if the specified option user does not exist or is unknown logged in, or if the specified value is invalidoptional database could not be opened for modification.
|}
==SHOW BACKUPSGRANT==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>SHOW BACKUPSGRANT [NONE&#124;READ&#124;WRITE&#124;CREATE&#124;ADMIN] (ON [database]) TO [user]</code>
|-
| valign='top' | '''Permission'''
|''CREATEADMIN''
|-
| valign='top' | '''Summary'''
|Shows Grants the specified [[User_Management|permission]] to the specified <code>[user]</code>. If a <code>[database]</code> is specified, the permissions are only granted locally. The Glob syntax can be used to address more than one database or user.|-| valign='top' | '''Errors'''|The command fails if <code>admin</code> is specified as user name, if the specified user does not exist, or if the optional database could not be opened for modification.|-| valign='top' | '''Examples'''|* <code>GRANT READ TO JoeWinson</code><br/>grants <code>READ</code> permission to the user <code>JoeWinson</code>.* <code>GRANT WRITE ON Wiki TO editor*</code><br/>grants <code>WRITE</code> permissions on the <code>Wiki</code> database to all database backupsusers starting with the characters <code>editor*</code>.
|}
 ==SHOW DATABASESPASSWORD==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>SHOW DATABASESPASSWORD ([password])</code>
|-
| valign='top' | '''Permission'''
|''ADMINNONE''
|-
| valign='top' | '''Summary'''
|Shows all databases that are opened Changes the <code>[password]</code> of the current user. The password must be a valid MD5 hash value. If no password is specified in the current server instanceconsole mode, it is requested via standard input.|-| valign='top' | '''Errors'''|The command fails if the password is no valid MD5 hash value.
|}
 =General Commands=SHOW SESSIONS ==GET==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>SHOW SESSIONSGET [option]</code>
|-
| valign='top' | '''Permission'''
|''ADMINREAD''
|-
| valign='top' | '''Summary'''
|Shows all sessions that are connected to Returns the current server instancevalue of the [[Options|Option]] specified via {{Mono|[key]}}.|-| valign='top' | '''Errors'''|The command fails if the specified option is unknown.
|}
 ==SHOW EVENTSSET==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>SHOW EVENTSSET [option] ([value])</code>
|-
| valign='top' | '''Permission'''
|''ADMINREAD''
|-
| valign='top' | '''Summary'''
|Shows all Sets the [[EventsOptions|eventsOption]] with the specified <code>[key]</code> to a new <code>[value] that have been registered in </code>. If no value is specified, and if the value is boolean, it will be inverted.|-| valign='top' | '''Errors'''|The command fails if the specified option is unknown or if the databasespecified value is invalid.
|}
==SHOW USERSINFO==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>SHOW USERS (ON [database])INFO</code>
|-
| valign='top' | '''Permission'''
|''ADMINREAD''
|-
| valign='top' | '''Summary'''
|Shows all users that are registered in the database. If a <code>[database]</code> is specified, local users are shown.|-| valign='top' | '''Errors'''|The command fails if the optional database could not be openedglobal information.
|}
==STOREHELP==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>STORE HELP (TO [pathcommand]) [input]</code>
|-
| valign='top' | '''Permission'''
|''WRITENONE''
|-
| valign='top' | '''Summary'''
|Stores raw data to the specified If <code>[pathcommand]</code>. <code>[input]</code> may either be a file referenceis specified, a remote URL, or a plain string. If information on the path denotes a directoryspecific command is printed; otherwise, it needs to be suffixed with a slash (<code>/</code>)all commands are listed.
|-
| valign='top' | '''Errors'''
|The command fails if no database is opened, if the specified resource is not found, if the target path command is invalid or if the data cannot not be written for some other reasonunknown.
|}
==XQUERYEXIT==
{|
|-
| valign='top' width='90' | '''Signature'''
|<code>XQUERY [query]EXIT </code>
|-
| valign='top' | '''Permission'''
|''depends on queryNONE''
|-
| valign='top' | '''Summary'''
|Runs Exits the specified <code>[query]</code> and prints the result.|-| valign='top' | '''Errors'''|The command fails if the specified query is invalid.|-| valign='top' | '''Examples'''|* <code>XQUERY 1 to 10</code><br/>returns the sequence <code>(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)</code>.* <code>SET RUNS 10;XQUERY 1 to 10</code><br/>runs the query 10 times, returns the result and prints the average execution time.* <code>SET XMLPLAN true;XQUERY 1 to 10</code><br/>returns the result and prints the query plan as XMLconsole mode.
|}
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu