Changes

Jump to navigation Jump to search
667 bytes removed ,  11:45, 7 December 2010
Wikified the markup
<p>
Here you find a description of all database commands
which you can enter in the console mode, in the Command
text field in the GUI, or send to the BaseX server:</p>
==Database Commands==
===Create===
<p>
<code>CREATE [DB|FS|INDEX|USER] [...]</code><br/>
Creates a new database, index or user:
</p>
;<ulcode> CREATE [DB|FS|INDEX|USER] [...]<li/code> :Creates a new database, index or user: ;<code>DB [name] ([input])</code>: <br/> :creates the database <code>[name]</code> with an optional <code>[input]</code> </li> <li>;<code>INDEX [TEXT|ATTRIBUTE|FULLTEXT|PATH]</code>: <br/> :creates the specified index</li> <li>;<code>FS [name] [path] ([mountpoint] [backingstore])</code>: <br/> :creates filesystem database <code>[name]</code> for <code>[path]</code> (using <code>[mountpoint]</code> and <code>[backingstore]</code> if FUSE is activated)</li> <li>;<code>USER [name] ([password])</code>: <br/> :creates the specified user</li> </ul>
===Open===
<p> ;<code>OPEN [name]</code><br/> :Opens the specified database [name].</p>
===Add===
<p> ;<code>ADD (AS [name]) (TO [target]) [input]</code><br/> :Adds [input] as [name] to the database, using an optional[target] path.</p>
===Delete===
<p> ;<code>DELETE [name]</code><br/> :Deletes a document from the current database.</p>
===Info===
<p>
<code>INFO ([DB|INDEX|TABLE])</code><br/>
Shows information on the currently opened database:
</p>
;<ulcode> INFO ([DB|INDEX|TABLE])<li/code> ;Shows information on the currently opened database: * <code>no argument</code>: show global information<br/> </li> <li>* <code>DB</code>: shows database information<br/> </li> <li>* <code>INDEX</code>: shows index information<br/> </li> <li>* <code>TABLE [start end] | [query]</code>: show internal database table<br/> </li> </ul>
===Close===
<p> ;<code>CLOSE </code><br/> :Closes the current database.</p>
===List===
<p> ;<code>LIST </code><br/> :Lists all available databases.</p>
===Drop===
<p>
<code>DROP [DB|INDEX|USER] [...]</code><br/>
Drops a database, index or user:
</p>
;<ulcode> DROP [DB|INDEX|USER] [...]<li/code> :Drops a database, index or user: ;<code>DB [name]</code>: <br/> : drops the database</li> <li>;<code>INDEX [PATH|TEXT|ATTRIBUTE|FULLTEXT]</code>: <br/> :drops the specified index</li> <li>;<code>USER [name]</code>: <br/> :drops the specified user</li> </ul>
===Export===
<p> ;<code>EXPORT [path]</code><br/> :Exports the database to [path].</p>
===Optimize===
<p> ;<code>OPTIMIZE </code><br/> :Optimizes the current database structures.</p>
==Query Commands==
===Xquery===
<p> ;<code>XQUERY [query]</code><br/> :Evaluates the specified query and prints the result.</p>
===Find===
<p> ;<code>FIND [query]</code><br/> :The following modifiers can be used:</p>
===Run===
<p> ;<code>RUN [path]</code><br/> :Evaluates an query from [path] and prints the result.</p>
===CS===
<p> ;<code>CS [query]</code><br/> :Evaluates the query and sets the result as new context set.</p>
==Admin Commands==
===Show===
<p>
<code>SHOW [DATABASES|SESSIONS|USERS|BACKUPS]</code><br/>
Shows server information:
</p>
;<ulcode> SHOW [DATABASES|SESSIONS|USERS|BACKUPS]<li/code> :Shows server information:* <code>DATABASES</code>: shows currently opened databases.<br/> </li> <li>* <code>SESSIONS</code>: shows current database sessions.<br/> </li> <li>* <code>USERS (ON [db])</code>: shows users (on a database).<br/> </li> <li>* <code>BACKUPS</code>: shows backups.<br/> </li> </ul>
===Grant===
<p> ;<code>GRANT [NONE|READ|WRITE|CREATE|ADMIN] (ON [db]) TO [user]</code><br/> :Grants permissions (on a database) to a user.</p>
===Alter===
<p>
<code>ALTER [USER|DB] [...]</code><br/>
Alters user password or database name:
</p>
;<ulcode> ALTER [USER|DB] [...]<li/code> :Alters user password or database name: ; <code>USER [name] ([password])</code>: <br/> : alters the password of a user.</li> <li>; <code>DB [name] [newname]</code>: <br/> : alters the name of a database.</li> </ul>
===Kill===
<p> ;<code>KILL [name]</code><br/> :Kills all sessions of the specified user.</p>
===Backup===
<p> ;<code>BACKUP [name]</code><br/> :Creates a backup of the specified database.</p>
===Restore===
<p> ;<code>RESTORE [name]</code><br/> :Restores a backup of the specified database.</p>
==General Commands==
===Set===
<p>
<code>SET [option] ([value])</code><br/>
Available options [option] with value [value] = on/off:
</p>
;<ulcode> SET [option] ([value])<li/code> :Available options [option] with value [value] = on/off: * <code>QUERYINFO</code>: Display of query info<br/> </li> <li>* <code>DEBUG</code>: Display of debug info<br/> </li> <li>* <code>SERIALIZE</code>: Serialization of query results<br/> </li> <li>* <code>CHOP</code>: Chopping of XML whitespaces<br/> </li> <li>* <code>ENTITY</code>: Parsing of XML entities<br/> </li> <li>* <code>TEXTINDEX</code>: Text indexing<br/> </li> <li>* <code>ATTRINDEX</code>: Attribute value indexing<br/> </li> <li>* <code>FTINDEX</code>: Full-text indexing<br/> </li> <li>* <code>PATHINDEX</code>: Path indexing<br/> </li> <li>* <code>WRITEBACK</code>: Propagating changes to input file<br/> </li> </ul>
Have a look into [[Settings]] to find
a complete list of available options.<br /> 
===Password===
<p> ;<code>PASSWORD ([password])</code><br/> :Changes the user's password.</p>
===Help===
<p> ;<code>HELP ([command])</code><br/> :If [command] is specified, information on the specificcommand is printed; otherwise, all commands are listed.</p>
===Exit===
<p> ;<code>EXIT </code><br/> :Exits BaseX.</p>
administrator, Bureaucrats, editor, Interface administrators, reviewer, Administrators
401

edits

Navigation menu