Difference between revisions of "Commands"
(→LIST) |
|||
Line 34: | Line 34: | ||
===CREATE=== | ===CREATE=== | ||
− | '''<code>CREATE [ | + | '''<code>CREATE [DB|FS|INDEX|USER] [...]</code>''' |
Creates a new database, index or user: | Creates a new database, index or user: | ||
− | * <code> | + | * <code>DB [name] ([input])</code>: |
: creates the database <code>[name]</code> with an optional <code>[input]</code> | : creates the database <code>[name]</code> with an optional <code>[input]</code> | ||
* <code>INDEX [TEXT|ATTRIBUTE|FULLTEXT|PATH]</code>: | * <code>INDEX [TEXT|ATTRIBUTE|FULLTEXT|PATH]</code>: | ||
Line 61: | Line 61: | ||
===DROP=== | ===DROP=== | ||
− | '''<code>DROP [ | + | '''<code>DROP [DB|INDEX|USER] [...]</code>''' |
Drops a database, index or user: | Drops a database, index or user: | ||
− | * <code> | + | * <code>DB [name]</code>: |
: drops the database | : drops the database | ||
* <code>INDEX [PATH|TEXT|ATTRIBUTE|FULLTEXT]</code>: | * <code>INDEX [PATH|TEXT|ATTRIBUTE|FULLTEXT]</code>: | ||
Line 120: | Line 120: | ||
===INFO=== | ===INFO=== | ||
− | '''<code>INFO ([ | + | '''<code>INFO ([DB|INDEX|STORAGE])</code>''' |
Shows information on the currently opened database: | Shows information on the currently opened database: | ||
* <code>no argument</code>: show global information | * <code>no argument</code>: show global information | ||
− | * <code> | + | * <code>DB</code>: shows database information |
* <code>INDEX</code>: shows index information | * <code>INDEX</code>: shows index information | ||
* <code>STORAGE [start end] | [query]</code>: show internal database table | * <code>STORAGE [start end] | [query]</code>: show internal database table |
Revision as of 01:47, 24 January 2011
This page lists all database commands, which are supported by BaseX.
ADD
ADD (AS [name]) (TO [target]) [input]
Adds [input]
as [name]
to the database, using an optional
[target]
path.
ALTER
ALTER [USER|DATABASE] [...]
Alters user password or database name:
USER [name] ([password])
:
- alters the password of a user.
DATABASE [name] [newname]
- alters the name of a database.
BACKUP
BACKUP [name]
Creates a backup of the specified database.
CLOSE
CLOSE
Closes the currently opened database.
CREATE
CREATE [DB|FS|INDEX|USER] [...]
Creates a new database, index or user:
DB [name] ([input])
:
- creates the database
[name]
with an optional[input]
INDEX [TEXT|ATTRIBUTE|FULLTEXT|PATH]
:
- creates the specified index
FS [name] [path] ([mountpoint] [backingstore])
:
- creates filesystem database
[name]
for[path]
- (using
[mountpoint]
and[backingstore]
if FUSE is activated)
USER [name] ([password])
:
- creates the specified user
CS
CS [query]
Evaluates the query and sets the result as new context set.
DELETE
DELETE [name]
Deletes documents from the currently opened database.
DROP
DROP [DB|INDEX|USER] [...]
Drops a database, index or user:
DB [name]
:
- drops the database
INDEX [PATH|TEXT|ATTRIBUTE|FULLTEXT]
:
- drops the specified index
USER [name]
:
- drops the specified user
BACKUP [name]
:
- drops the database backup
EXIT
EXIT
Exits the BaseX console.
EXPORT
EXPORT [path]
Exports the database to [path]
.
FIND
FIND [query]
The following modifiers can be used:
- = : looks for exact text nodes"
- @= : looks for exact attributes
- @ : looks for attributes
GET
GET [option]
Shows the value of a global option.
Have a look into Options to find a complete list of available options.
GRANT
GRANT [NONE|READ|WRITE|CREATE|ADMIN] (ON [db]) TO [user]
Grants permissions (on a database) to a user.
HELP
HELP ([command])
If [command]
is specified, information on the specific
command is printed; otherwise, all commands are listed.
INFO
INFO ([DB|INDEX|STORAGE])
Shows information on the currently opened database:
no argument
: show global informationDB
: shows database informationINDEX
: shows index informationSTORAGE [start end] | [query]
: show internal database table
KILL
KILL [name]
Kills all sessions of the specified user.
LIST
LIST ([path])
Lists all available databases, or the documents within a database [path].
OPEN
OPEN [name]
Opens the specified database [name]
.
OPTIMIZE
OPTIMIZE
Optimizes the current database structures.
PASSWORD
PASSWORD ([password])
Changes the user's password.
RESTORE
RESTORE [name]
Restores a backup of the specified database.
RUN
RUN [path]
Evaluates an query from [path]
and prints the result.
SET
SET [option] ([value])
Available options [option]
with value [value]
= on/off:
QUERYINFO
: Display of query infoDEBUG
: Display of debug infoSERIALIZE
: Serialization of query resultsCHOP
: Chopping of XML whitespacesENTITY
: Parsing of XML entitiesTEXTINDEX
: Text indexingATTRINDEX
: Attribute value indexingFTINDEX
: Full-text indexingPATHINDEX
: Path indexing
Have a look into Options to find a complete list of available options.
SHOW
SHOW [DATABASES|SESSIONS|USERS|BACKUPS]
Shows server information:
DATABASES
: shows currently opened databases.SESSIONS
: shows current database sessions.USERS (ON [db])
: shows users (on a database).BACKUPS
: shows backups.
XQUERY
XQUERY [query]
Evaluates the specified query and prints the result.