Changes

Jump to navigation Jump to search
516 bytes added ,  02:18, 16 December 2010
no edit summary
which you can enter in the console mode, in the Command
text field in the GUI, or send to the BaseX server:
 
==ADD==
 
'''<code>ADD (AS [name]) (TO [target]) [input]</code>'''
 
Adds '''<code>[input]</code>''' as '''<code>[name]</code>''' to the database, using an optional
'''<code>[target]</code>''' path.
 
==ALTER==
 
'''<code>ALTER [USER|DATABASE] [...]</code>'''
 
Alters user password or database name:
 
* '''<code>USER [name] ([password])</code>''':
: alters the password of a user.
 
* '''<code>DATABASE [name] [newname]</code>'''
: alters the name of a database.
 
==BACKUP==
 
'''<code>BACKUP [name]</code>'''
 
Creates a backup of the specified database.
 
==CLOSE==
 
'''<code>CLOSE </code>'''
 
Closes the currently opened database.
==CREATE==
Creates a new database, index or user:
* '''<code>DATABASE [name] ([input]):</code>''':
: creates the database '''<code>[name]</code>''' with an optional '''<code>[input]</code>'''
* '''<code>INDEX [TEXT|ATTRIBUTE|FULLTEXT|PATH]: </code>''':
: creates the specified index
* '''<code>FS [name] [path] ([mountpoint] [backingstore]): </code>''':
: creates filesystem database '''<code>[name]</code>''' for '''<code>[path]</code>'''
: (using '''<code>[mountpoint]</code>''' and '''<code>[backingstore]</code>''' if FUSE is activated)
* '''<code>USER [name] ([password]): </code>''':
: creates the specified user
==CS=Open=== ;<code>OPEN [name]</code> :Opens the specified database [name]. ===Add=== ;<code>ADD (AS [name]) (TO [target]) [input]</code> :Adds [input] as [name] to the database, using an optional [target] path. ===Delete=== ;<code>DELETE [name]</code> :Deletes documents from the current database.
===Info=== ;<code>INFO ([DB|INDEX|STORAGE])</code> ;Shows information on the currently opened database: * <code>no argument</code>: show global information * <code>DB</code>: shows database information * '''<code>INDEX</code>: shows index information * <code>STORAGE [start end] | CS [query]</code>: show internal database table: '''what is start end?'''
===Close=== ;<code>CLOSE </code> :Closes Evaluates the current database. ===List=== ;<code>LIST </code> :Lists all available databases. ===Drop=== ;<code>DROP [DB|INDEX|USER] [..query and sets the result as new context set.]</code> :Drops a database, index or user:
;==DELETE== '''<code>DB DELETE [name]</code>''' Deletes documents from the currently opened database. ==DROP== '''<code>DROP [DATABASE|INDEX|USER] [...]</code>''' Drops a database, index or user: * '''<code>DATABASE [name]</code>''':
: drops the database
;<code>INDEX [PATH|TEXT|ATTRIBUTE|FULLTEXT]</code>:
:drops the specified index
;<code>USER [name]</code>:
:drops the specified user
===Export===
;<code>EXPORT [path]</code>
:Exports the database to [path].
===Optimize===
;<code>OPTIMIZE </code>
:Optimizes the current database structures.
==* '''<code>INDEX [[Query Commands]PATH|TEXT|ATTRIBUTE|FULLTEXT]==</code>''':Moved to own section.: drops the specified index
==Admin Commands== * '''<code>USER [name]</code>''':===Show=== : drops the specified user ;* '''<code>SHOW BACKUP [DATABASES|SESSIONS|USERS|BACKUPSname]</code> '''::Shows server information:drops the database backup ==EXIT== * '''<code>DATABASESEXIT </code>: shows currently opened databases''' Exits BaseX. * ==EXPORT== '''<code>SESSIONSEXPORT [path]</code>: shows current ''' Exports the database sessions. * to '''<code>USERS (ON [dbpath])</code>: shows users (on a database)'''. * ==FIND== '''<code>BACKUPSFIND [query]</code>''' The following modifiers can be used:: = shows backups. : looks for exact text nodes" :@= : looks for exact attributes:@ : looks for attributes ===Grant=GRANT== ;'''<code>GRANT [NONE|READ|WRITE|CREATE|ADMIN] (ON [db]) TO [user]</code> ''' :Grants permissions (on a database) to a user. ===Alter=HELP== ;'''<code>ALTER HELP ([USER|DBcommand] )</code>''' If '''<code>[...command]</code> ''' is specified, information on the specificcommand is printed; otherwise, all commands are listed. :Alters user password or database name:==INFO== ; '''<code>USER [name] INFO ([passwordDATABASE|INDEX|STORAGE])</code>''' Shows information on the currently opened database: * '''<code>no argument</code>''': show global information * '''<code>DATABASE</code>''': alters the password of a user.shows database information * '''<code>INDEX</code>''': shows index information ; * '''<code>DB STORAGE [namestart end] | [newnamequery]</code>''': : alters the name of a show internal database.table ===Kill=KILL== ;'''<code>KILL [name]</code> ''' :Kills all sessions of the specified user. ==LIST=Backup'''<code>LIST </code>''' Lists all available databases. ==OPEN== ;'''<code>BACKUP OPEN [name]</code> ''' :Creates a backup of Opens the specified database'''<code>[name]</code>'''. ==OPTIMIZE== '''<code>OPTIMIZE </code>''' Optimizes the current database structures. ==PASSWORD== '''<code>PASSWORD ([password])</code>''' Changes the user's password. =Restore=RESTORE== ;'''<code>RESTORE [name]</code> ''' :Restores a backup of the specified database. ==RUN== '''<code>RUN [path]</code>''' Evaluates an query from '''<code>[path]</code>''' and prints the result. ==SET== '''<code>SET [option] ([value])</code>''' Available options '''<code>[option]</code>''' with value '''<code>[value]</code>''' = on/off: * '''<code>QUERYINFO</code>''': Display of query info * '''<code>DEBUG</code>''': Display of debug info * '''<code>SERIALIZE</code>''': Serialization of query results * '''<code>CHOP</code>''': Chopping of XML whitespaces * '''<code>ENTITY</code>''': Parsing of XML entities * '''<code>TEXTINDEX</code>''': Text indexing * '''<code>ATTRINDEX</code>''': Attribute value indexing * '''<code>FTINDEX</code>''': Full-text indexing * '''<code>PATHINDEX</code>''': Path indexing ==SHOW== '''<code>SHOW [DATABASES|SESSIONS|USERS|BACKUPS]</code>''' Shows server information: * '''<code>DATABASES</code>''': shows currently opened databases. * '''<code>SESSIONS</code>''': shows current database sessions.
==General Commands== ===Set=== Have a look into [[Settings]] to find a complete list of available options. ;* '''<code>SET [option] USERS (ON [valuedb])</code> ''':Available options [option] with value [value] = shows users (on/off: * <code>QUERYINFO</code>: Display of query info * <code>DEBUG</code>: Display of debug info * <code>SERIALIZE</code>: Serialization of query results* <code>CHOP</code>: Chopping of XML whitespaces* <code>ENTITY</code>: Parsing of XML entities * <code>TEXTINDEX</code>: Text indexing * <code>ATTRINDEX</code>: Attribute value indexing * <code>FTINDEX</code>: Full-text indexing * <code>PATHINDEX</code>: Path indexing * <code>WRITEBACK</code>: Propagating changes to input filea database).
===Password=== ;* '''<code>PASSWORD ([password])BACKUPS</code>''':Changes the user's passwordshows backups.
==XQUERY=Help=== ;<code>HELP ([command])</code>:If [command] is specified, information on the specific command is printed; otherwise, all commands are listed.
===Exit=== ;'''<code>EXIT XQUERY [query]</code> :Exits BaseX.'''
[[Category:Commands]]Evaluates the specified query and prints the result.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu