Difference between revisions of "Commands"
m (Text replace - "| valign='top' | " to "| ") |
m (Text replace - "| valign='top' width='90' |" to "| width='90' |") |
||
Line 15: | Line 15: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>CREATE DATABASE [name] ([input])</code> | |<code>CREATE DATABASE [name] ([input])</code> | ||
|- | |- | ||
Line 38: | Line 38: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>OPEN [path]</code> | |<code>OPEN [path]</code> | ||
|- | |- | ||
Line 54: | Line 54: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>CHECK [input]</code> | |<code>CHECK [input]</code> | ||
|- | |- | ||
Line 70: | Line 70: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>CLOSE </code> | |<code>CLOSE </code> | ||
|- | |- | ||
Line 86: | Line 86: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>EXPORT [path]</code> | |<code>EXPORT [path]</code> | ||
|- | |- | ||
Line 104: | Line 104: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>CREATE INDEX [TEXT|ATTRIBUTE|FULLTEXT]</code> | |<code>CREATE INDEX [TEXT|ATTRIBUTE|FULLTEXT]</code> | ||
|- | |- | ||
Line 122: | Line 122: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>DROP INDEX [TEXT|ATTRIBUTE|FULLTEXT]</code> | |<code>DROP INDEX [TEXT|ATTRIBUTE|FULLTEXT]</code> | ||
|- | |- | ||
Line 140: | Line 140: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>ALTER DATABASE [name] [newname]</code> | |<code>ALTER DATABASE [name] [newname]</code> | ||
|- | |- | ||
Line 160: | Line 160: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>DROP DATABASE [name]</code> | |<code>DROP DATABASE [name]</code> | ||
|- | |- | ||
Line 176: | Line 176: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>CREATE BACKUP [name]</code> | |<code>CREATE BACKUP [name]</code> | ||
|- | |- | ||
Line 196: | Line 196: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>RESTORE [name]</code> | |<code>RESTORE [name]</code> | ||
|- | |- | ||
Line 212: | Line 212: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>DROP BACKUP [name]</code> | |<code>DROP BACKUP [name]</code> | ||
|- | |- | ||
Line 229: | Line 229: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>SHOW BACKUPS</code> | |<code>SHOW BACKUPS</code> | ||
|- | |- | ||
Line 242: | Line 242: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>COPY [name] [newname]</code> | |<code>COPY [name] [newname]</code> | ||
|- | |- | ||
Line 258: | Line 258: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>INFO DATABASE</code> | |<code>INFO DATABASE</code> | ||
|- | |- | ||
Line 274: | Line 274: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>INFO INDEX ([TEXT|ATTRIBUTE|FULLTEXT|PATH])</code> | |<code>INFO INDEX ([TEXT|ATTRIBUTE|FULLTEXT|PATH])</code> | ||
|- | |- | ||
Line 290: | Line 290: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
| <code>INFO STORAGE [start end] | [query]</code> | | <code>INFO STORAGE [start end] | [query]</code> | ||
|- | |- | ||
Line 308: | Line 308: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>LIST ([path])</code> | |<code>LIST ([path])</code> | ||
|- | |- | ||
Line 324: | Line 324: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>XQUERY [query]</code> | |<code>XQUERY [query]</code> | ||
|- | |- | ||
Line 346: | Line 346: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>RETRIEVE [path] [input]</code> | |<code>RETRIEVE [path] [input]</code> | ||
|- | |- | ||
Line 362: | Line 362: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>RUN [file]</code> | |<code>RUN [file]</code> | ||
|- | |- | ||
Line 378: | Line 378: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>FIND [keywords]</code> | |<code>FIND [keywords]</code> | ||
|- | |- | ||
Line 395: | Line 395: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>CS [query]</code> | |<code>CS [query]</code> | ||
|- | |- | ||
Line 411: | Line 411: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>REPO INSTALL [path]</code> | |<code>REPO INSTALL [path]</code> | ||
|- | |- | ||
Line 433: | Line 433: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>REPO LIST</code> | |<code>REPO LIST</code> | ||
|- | |- | ||
Line 446: | Line 446: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>REPO DELETE [name|dir]</code> | |<code>REPO DELETE [name|dir]</code> | ||
|- | |- | ||
Line 464: | Line 464: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>ADD (TO [path]) [input]</code> | |<code>ADD (TO [path]) [input]</code> | ||
|- | |- | ||
Line 486: | Line 486: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>DELETE [path]</code> | |<code>DELETE [path]</code> | ||
|- | |- | ||
Line 502: | Line 502: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>RENAME [path] [newpath]</code> | |<code>RENAME [path] [newpath]</code> | ||
|- | |- | ||
Line 523: | Line 523: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>REPLACE [path] [input]</code> | |<code>REPLACE [path] [input]</code> | ||
|- | |- | ||
Line 544: | Line 544: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>STORE (TO [path]) [input]</code> | |<code>STORE (TO [path]) [input]</code> | ||
|- | |- | ||
Line 560: | Line 560: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>OPTIMIZE (ALL)</code> | |<code>OPTIMIZE (ALL)</code> | ||
|- | |- | ||
Line 576: | Line 576: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>FLUSH</code> | |<code>FLUSH</code> | ||
|- | |- | ||
Line 594: | Line 594: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>SHOW DATABASES</code> | |<code>SHOW DATABASES</code> | ||
|- | |- | ||
Line 607: | Line 607: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>SHOW SESSIONS</code> | |<code>SHOW SESSIONS</code> | ||
|- | |- | ||
Line 620: | Line 620: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>SHOW USERS (ON [database])</code> | |<code>SHOW USERS (ON [database])</code> | ||
|- | |- | ||
Line 636: | Line 636: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>KILL [target]</code> | |<code>KILL [target]</code> | ||
|- | |- | ||
Line 652: | Line 652: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>CREATE EVENT [NAME]</code> | |<code>CREATE EVENT [NAME]</code> | ||
|- | |- | ||
Line 668: | Line 668: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>SHOW EVENTS</code> | |<code>SHOW EVENTS</code> | ||
|- | |- | ||
Line 681: | Line 681: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>DROP EVENT [NAME]</code> | |<code>DROP EVENT [NAME]</code> | ||
|- | |- | ||
Line 699: | Line 699: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>CREATE USER [name] ([password])</code> | |<code>CREATE USER [name] ([password])</code> | ||
|- | |- | ||
Line 715: | Line 715: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>ALTER USER [name] ([password])</code> | |<code>ALTER USER [name] ([password])</code> | ||
|- | |- | ||
Line 731: | Line 731: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>DROP USER [name] (ON [database])</code>: | |<code>DROP USER [name] (ON [database])</code>: | ||
|- | |- | ||
Line 747: | Line 747: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>GRANT [NONE|READ|WRITE|CREATE|ADMIN] (ON [database]) TO [user]</code> | |<code>GRANT [NONE|READ|WRITE|CREATE|ADMIN] (ON [database]) TO [user]</code> | ||
|- | |- | ||
Line 768: | Line 768: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>PASSWORD ([password])</code> | |<code>PASSWORD ([password])</code> | ||
|- | |- | ||
Line 787: | Line 787: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>GET [option]</code> | |<code>GET [option]</code> | ||
|- | |- | ||
Line 804: | Line 804: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>SET [option] ([value])</code> | |<code>SET [option] ([value])</code> | ||
|- | |- | ||
Line 820: | Line 820: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>INFO</code> | |<code>INFO</code> | ||
|- | |- | ||
Line 833: | Line 833: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>HELP ([command])</code> | |<code>HELP ([command])</code> | ||
|- | |- | ||
Line 849: | Line 849: | ||
{| | {| | ||
|- | |- | ||
− | | | + | | width='90' | '''Signature''' |
|<code>EXIT </code> | |<code>EXIT </code> | ||
|- | |- |
Revision as of 00:43, 26 May 2012
This article is linked from the Getting Started Section.
It lists all database commands supported by BaseX.
Commands can e.g. be run from the Command Line,
the Clients, REST, the input field in the GUI, and in numerous
other ways. If the GUI is used, all commands that are triggered by the GUI itself
will show up in the Info View.
The Permission fields indicate which
rights are required by a user to perform a command in the client/server architecture.
A shortcut exists for some of the command keywords. For example, you may replace
the DATABASE
keyword with DB
.
Contents
Database Operations
CREATE DATABASE
Signature | CREATE DATABASE [name] ([input])
|
Permission | CREATE |
Summary | Creates the database [name] with an optional [input] .The input may either be a reference to a single XML document, a directory, a remote URL, or a string containing XML. [name] must be a valid database name.
|
Errors | The command fails if a database with the specified name is currently used by another process, if one of the documents to be added is not well-formed or if it cannot be parsed for some other reason. |
Examples |
|
OPEN
Signature | OPEN [path]
|
Permission | READ |
Summary | Opens a database or some of its documents. [path] is the name of the database. If the name is further refined by a path, only some of the documents in the database will be opened.
|
Errors | The command fails if the specified database does not exist, is currently being updated by another process, cannot be opened for some other reason. |
CHECK
Signature | CHECK [input]
|
Permission | READ/CREATE |
Summary | This command combines OPEN and CREATE DATABASE: if a database with the name [input] exists, it is opened. Otherwise, it creates a new database and stores the specified input as initial content.
|
Errors | The command fails if the addressed database could neither be opened nor created. |
CLOSE
Signature | CLOSE
|
Permission | READ |
Summary | Closes the currently opened database. |
Errors | The command fails if the database files could not be closed for some reason. |
EXPORT
Signature | EXPORT [path]
|
Permission | CREATE |
Summary | Exports all documents in the database to the specified [path] , using the serializer options specified by the EXPORTER option.
|
Errors | The command fails if no database is opened, if the target path points to a file or is invalid, if the serialization parameters are invalid, or if the documents cannot be serialized for some other reason. |
CREATE INDEX
Template:Mark PATH
removed as argument; path summary is now updated by OPTIMIZE command
Signature | CREATE INDEX [TEXT|ATTRIBUTE|FULLTEXT]
|
Permission | WRITE |
Summary | Creates the specified database index. |
Errors | The command fails if no database is opened, if the specified index is unknown, or if indexing fails for some other reason. |
DROP INDEX
Template:Mark PATH
removed as argument; path summary is now always available
Signature | DROP INDEX [TEXT|ATTRIBUTE|FULLTEXT]
|
Permission | WRITE |
Summary | Drops the specified database index. |
Errors | The command fails if no database is opened, if the specified index is unknown, or if it could not be deleted for some other reason. |
Administration
ALTER DATABASE
Signature | ALTER DATABASE [name] [newname]
|
Permission | CREATE |
Summary | Renames the database specified by [name] to [newname] . [newname] must be a valid database name.
|
Errors | The command fails if 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. |
Examples |
|
DROP DATABASE
Signature | DROP DATABASE [name]
|
Permission | CREATE |
Summary | Drops the database with the specified [name] . The Glob Syntax can be used to address more than one database.
|
Errors | The command fails if the specified database does not exist or is currently locked, or if the database could not be deleted for some other reason. |
CREATE BACKUP
Signature | CREATE BACKUP [name]
|
Permission | CREATE |
Summary | Creates a zipped backup of the database specified by [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.
|
Errors | The command fails if the specified database does not exist, or if it could not be zipped for some other reason. |
Examples |
|
RESTORE
Signature | RESTORE [name]
|
Permission | CREATE |
Summary | Restores a database with the specified [name] . The name may include the timestamp of the backup file.
|
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. |
DROP BACKUP
Signature | DROP BACKUP [name]
|
Permission | CREATE |
Summary | Drops all backups of the database with the specified [name] . The Glob Syntax can be used to address more than one database.
|
Examples |
|
SHOW BACKUPS
Signature | SHOW BACKUPS
|
Permission | CREATE |
Summary | Shows all database backups. |
COPY
Signature | COPY [name] [newname]
|
Permission | CREATE |
Summary | Creates a copy of the database specified by [name] . [newname] must be a valid database name.
|
Errors | The command fails if the target database already exists, or if the source database does not exist. |
INFO DATABASE
Signature | INFO DATABASE
|
Permission | READ |
Summary | Shows information on the currently opened database. |
Errors | The command fails if no database is opened. |
INFO INDEX
Signature | INFO INDEX ([TEXT|ATTRIBUTE|FULLTEXT|PATH])
|
Permission | READ |
Summary | Shows information on the existing index structures. The output can be optionally limited to the specified index. |
Errors | The command fails if no database is opened, or if the specified index is unknown. |
INFO STORAGE
Signature | INFO STORAGE [start end] | [query]
|
Permission | READ |
Summary | Shows the internal main table of the currently opened database. An integer range or a query may be specified as argument. |
Errors | The command fails if no database is opened, or if one of the specified arguments is invalid. |
Querying
LIST
Signature | LIST ([path])
|
Permission | NONE |
Summary | Lists all available databases, or the documents in a database. [path] is the name of the database, optionally followed by a path to the requested documents.
|
Errors | The command fails if the optional database cannot be opened, or if the existing databases cannot be listed for some other reason. |
XQUERY
Signature | XQUERY [query]
|
Permission | depends on query |
Summary | Runs the specified [query] and prints the result.
|
Errors | The command fails if the specified query is invalid. |
Examples |
|
RETRIEVE
Signature | RETRIEVE [path] [input]
|
Permission | READ |
Summary | Retrieves raw data from the specified database [path] .
|
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. |
RUN
Signature | RUN [file]
|
Permission | depends on query |
Summary | Runs the query contained in [file] and prints the result.
|
Errors | The command fails if the specified file does not exist, or if the retrieved query is invalid. |
FIND
Signature | FIND [keywords]
|
Permission | READ |
Summary | Builds and runs a query for the specified [keywords] . Keywords can be enclosed in quotes to look for phrases. The following modifiers can be used to further limit search:
|
Errors | The command fails if no database is opened. |
CS
Signature | CS [query]
|
Permission | depends on query |
Summary | Evaluates the specified [query] and sets the result as new context set.
|
Errors | The command fails if no database is opened, if the specified query is invalid or if it does not return nodes of the currently opened database. |
REPO INSTALL
Signature | REPO INSTALL [path]
|
Permission | CREATE (Template:Mark: ADMIN) |
Summary | Installs the package with path [path] .
|
Errors | The command fails in the following cases:
|
REPO LIST
Signature | REPO LIST
|
Permission | READ (Template:Mark: ADMIN) |
Summary | Lists all installed packages. |
REPO DELETE
Signature | REPO DELETE [name|dir]
|
Permission | CREATE (Template:Mark: ADMIN) |
Summary | Deletes the package with name [name] or with directory [dir] .
|
Errors | The command fails if the package to be deleted participates in a dependency. |
Updates
ADD
Signature | ADD (TO [path]) [input]
|
Permission | WRITE |
Summary | Adds the files, directory or XML string specified by [input] to the currently opened database at the specified [path] .[input] 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 (/ ).
|
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. |
Examples |
|
DELETE
Signature | DELETE [path]
|
Permission | WRITE |
Summary | Deletes all documents from the currently opened database that start with the specified [path] .
|
Errors | The command fails if no database is opened. |
RENAME
Signature | RENAME [path] [newpath]
|
Permission | WRITE |
Summary | Renames all document paths in the currently opened database that start with the specified [path] . The command may be used to either rename single documents or directories.
|
Errors | The command fails if no database is opened, or if the target path is empty. |
Examples |
|
REPLACE
Signature | REPLACE [path] [input]
|
Permission | WRITE |
Summary | Replaces the documents in the currently opened database, addressed by [path] , with the file or XML string specified by [input] . The original file name and path is preserved by the operation.
|
Errors | The command fails if no database is opened, if the specified path points to a database directory, or if the input is not found. |
Examples |
|
STORE
Signature | STORE (TO [path]) [input]
|
Permission | WRITE |
Summary | Stores raw data to the specified [path] . [input] 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 (/ ).
|
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. |
OPTIMIZE
Signature | OPTIMIZE (ALL)
|
Permission | WRITE |
Summary | Optimizes the index structures, meta data and statistics of the currently opened database. If the ALL flag is specified, the internal database structures are completely rebuilt; this often leads to a reduction of the total database size.
|
Errors | The command fails if no database is opened, or if the currently opened database is a main-memory instance. |
FLUSH
Signature | FLUSH
|
Permission | WRITE |
Summary | Explicitly flushes the buffers of the currently opened database to disk. This command is applied if the AUTOFLUSH option has been set to false. |
Errors | The command fails if no database is opened. |
Server Administration
SHOW DATABASES
Signature | SHOW DATABASES
|
Permission | ADMIN |
Summary | Shows all databases that are opened in the current server instance. |
SHOW SESSIONS
Signature | SHOW SESSIONS
|
Permission | ADMIN |
Summary | Shows all sessions that are connected to the current server instance. |
SHOW USERS
Signature | SHOW USERS (ON [database])
|
Permission | ADMIN |
Summary | Shows all users that are registered in the database. If a [database] is specified, local users are shown.
|
Errors | The command fails if the optional database could not be opened. |
KILL
Signature | KILL [target]
|
Permission | ADMIN |
Summary | Kills sessions of a user or an IP:port combination, specified by [target] . The Glob Syntax can be used to address more than one user.
|
Errors | The command fails if a user tried to kill his/her own session. |
CREATE EVENT
Signature | CREATE EVENT [NAME]
|
Permission | ADMIN |
Summary | Creates the specified event. |
Errors | The command fails if event already exists. |
SHOW EVENTS
Signature | SHOW EVENTS
|
Permission | ADMIN |
Summary | Shows all events that have been registered in the database. |
DROP EVENT
Signature | DROP EVENT [NAME]
|
Permission | ADMIN |
Summary | Drops the specified event. |
Errors | The command fails if the event doesn't exist. |
User Management
CREATE USER
Signature | CREATE USER [name] ([password])
|
Permission | ADMIN |
Summary | Creates a user with the specified [name] and [password] . [name] must be a 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.
|
Errors | The command fails if the specified user already exists, or if the password is no valid MD5 hash value. |
ALTER USER
Signature | ALTER USER [name] ([password])
|
Permission | ADMIN |
Summary | Alters the [password] of the user specified by [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.
|
Errors | The command fails if the specified user does not exist, or if the password is no valid MD5 hash value. |
DROP USER
Signature | DROP USER [name] (ON [database]) :
|
Permission | ADMIN |
Summary | Drops the user with the specified [name] . If a [database] is specified, the user is only dropped locally. The Glob Syntax can be used to address more than one database or user.
|
Errors | The command fails if admin is specified as user name, if the specified user does not exist or is logged in, or if the optional database could not be opened for modification.
|
GRANT
Signature | GRANT [NONE|READ|WRITE|CREATE|ADMIN] (ON [database]) TO [user]
|
Permission | ADMIN |
Summary | Grants the specified permission to the specified [user] . If a [database] is specified, the permissions are only granted locally. The Glob Syntax can be used to address more than one database or user.
|
Errors | The command fails if admin is specified as user name, if the specified user does not exist, or if the optional database could not be opened for modification.
|
Examples |
|
PASSWORD
Signature | PASSWORD ([password])
|
Permission | NONE |
Summary | Changes the [password] of the current user. The password must be a valid MD5 hash value. If no password is specified in the console mode, it is requested via standard input.
|
Errors | The command fails if the password is no valid MD5 hash value. |
General Commands
GET
Template:Mark permission changed from READ
to NONE
Signature | GET [option]
|
Permission | NONE |
Summary | Returns the current value of the Option specified via [key] .
|
Errors | The command fails if the specified option is unknown. |
SET
Template:Mark permission changed from READ
to NONE
Signature | SET [option] ([value])
|
Permission | NONE |
Summary | Sets the Option with the specified [key] to a new [value] . If no value is specified, and if the value is boolean, it will be inverted.
|
Errors | The command fails if the specified option is unknown or if the specified value is invalid. |
INFO
Signature | INFO
|
Permission | READ |
Summary | Shows global information. |
HELP
Signature | HELP ([command])
|
Permission | NONE |
Summary | If [command] is specified, information on the specific command is printed; otherwise, all commands are listed.
|
Errors | The command fails if the specified command is unknown. |
EXIT
Signature | EXIT
|
Permission | NONE |
Summary | Exits the console mode. |
Conventions
Glob Syntax
For some commands, the glob syntax can be used to address more than one database or user. Question marks and asterisks can be used to match one or more characters, and commas can be used to separate multiple patterns. Some examples:
AB?
addresses all names with the charactersAB
and one more character.*AB
addresses all names ending with the charactersAB
.X*,Y*,Z*
addresses all names starting with the charactersX
,Y
, orZ
.
Valid Names
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 [-_a-zA-Z0-9]{1,128}
.
Shortcuts
In all commands, the DATABASE
keyword can be replaced by the shortcut DB
.
Changelog
Version 7.2.1
Version 7.2
- Updated:
CREATE INDEX
,DROP INDEX
(PATH
argument removed. Path summary is always available now and updated with OPTIMIZE) - Updated: permissions for
REPO DELETE
,REPO INSTALL
andREPO LIST
Version 7.1
- Updated:
KILL
(killing sessions by specifying IP:port)