Changes

Jump to navigation Jump to search
2,448 bytes removed ,  16:20, 16 February 2014
Undo revision 10443 by Holu (talk)
This page article is linked from part of the [[Getting Started]] Section.It lists all database commands supported by BaseX.Commands can e.g. be executed from the [[Command-Line Options#BaseX_Standalone|Command Line]],[[#Command Scripts|Scripts]], the [[Clients]], [[REST]], the input field in the [[GUI]]and other ways. If the GUI is used, all commands that are triggered by the GUI itselfwill show up in the [[GUI#Visualizations|Info View]].The [[User_Management|Permission]] fields indicate whichrights are required by a user to perform a command in the client/server architecture.
The options listed on this page influence the way how database [[Commands|commands]] are executed and XQuery expressions are evaluated. Options are divided into [[#Global Options|'''global options''']], which are valid for all BaseX instances, and '''local options''', which are specific to a client or session. Values of options are either ''strings'', ''numbers'' or ''booleans''.=Basics=
The {{Code|.basex}} [[Configuration#Configuration Files|configuration file]] is parsed by every new local BaseX instance. It contains all global options and, optionally, local options at the end of the file.==Command Scripts==
Various ways exist Database commands in both the string and XML syntax can be placed in a text file and stored on disk. The default extension for BaseX command scripts is {{Code|.bxs}}. If the path to a command script is passed on to access BaseX, it will automatically be recognized and change options:evaluated as such.
* The current value of an option can be requested with the [[Commands#GET|GET]] and changed with the [[Commands#SET|SET]] command. All values are ''static'': they stay valid until they are changed once again by another operation. If an option is of type ''boolean'', and if no value is specified, its existing value will be inverted.==String Syntax==
* Initial values for options Multiple commands can also be specified via system propertieswritten in a single line and separated by semicolons, which can eor stored as command script.g. be passed on Lines starting with the [http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/java.html<code>#options -D flag] on command line, or using [http:<//docscode> are interpreted as comments and are skipped.oracle.com/javase/6/docs/api/java/lang/System.html#setProperty(java.lang.StringThe following script creates a database,%20java.lang.String) System.setProperty()] before creating adds two documents to it and performs a BaseX instance. The specified keys needs to be prefixed with {{Code|org.basex.}}. An examplequery:
<pre class="brush:bashxml">java -DorgCREATE DB testADD input.basexxmlADD TO embedded.CHOP=false -cp basex.jar org.basex.BaseX -c"get chop"xml <root>embedded</root># run queryCHOP: falseXQUERY count(//text())
</pre>
* Options can also be set in the prolog of an XQuery expression. In the option declaration, options need to be bound to the [[Database Module]] namespace. All values will be reset after the evaluation of a query:==XML Syntax==
The string syntax is limited when XML snippets need to be embedded in a command,or when complex queries are to be specified. This is why database commands can also be specified in XML.Multiple commands can be enclosed by a {{Code|<commands/>}} root element: <pre class="brush:xqueryxml">declare option <commands> <create-db:chop name='falsetest';/> <add>input.xml</add> <add path='embedded..xml'><root>embedded</root></add> <xquery>count(//text())</xquery></commands>
</pre>
* Options can also be applied locally by using pragmas:==Glob Syntax==
<pre class="brushSome commands support the glob syntax 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:xquery">(# db:chop false #) { parse-xml('<xml> hi </xml>') }</pre>
If options are implicitly changed by operations in * {{Code|AB?}} addresses all names with the [[GUI]]characters {{Code|AB}} and one more character.* {{Code|*AB}} addresses all names ending with the characters {{Code|AB}}.* {{Code|X*,Y*, Z*}} addresses all names starting with the underlying commands will be listed in the [[GUI#Visualizationscharacters {{Code|X}}, {{Code|Y}}, or {{Code|Info View]]Z}}.<br/><br/>
=Global Options=Valid Names==
Global options Database, user and event names follow the same naming constraints: Names are constantsrestricted to ASCII characters. They can only be set in must at least have one character, and they may contain letters, numbers and any of the configuration file or via system properties special characters <code>!#$%&'(see above). One exception (since +-=@[]^_`{{Version|7.8}}) is the [[#debug|DEBUG]] option, which can also be changed at runtime by users with [[User Management|admin permissions]]~</code>.The following characters are reserved for other features:
==General==* <code>,?*</code>: [[#Glob Syntax|glob syntax]]* <code>;</code>: Separator for multiple database commands on the [[Command-Line Options|command line]]* <code>\/</code>: Directory path separators* <code>.</code>: hidden folders (e.g. the [[Logging|.logs directory]])* <code>:*?\"<>|}</code>: invalid filename characters on Windows
===DEBUG=Aliases==
{| width='100%'|-| width='120' | '''Signature'''|In all commands, the {{Code|DEBUG [boolean]DB}}|-| '''Default'''|keyword can be replaced by {{Code|falseDATABASE}}|-| '''Summary'''|Sends internal debug info to STDERR. This option can be turned on to get additional information for development and debugging purposes. It can also be triggered on [[Command-Line Options#BaseX Standalone|command line]] via <code>-d</code>.|}
=Database Operations==DBPATH==={| width='100%'|-| width='120' | '''Signature'''|{{Code|DBPATH [path]}}|-| '''Default'''|<code>[[Configuration#Database Directory|{home}/BaseXData]]</code> or <code>[[Configuration#Database Directory|{home}/data]]</code>|-| '''Summary'''|Points to the directory in which all databases are located.|}
===REPOPATH=CREATE DB==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|REPOPATH CREATE DB [pathname]([input])}}
|-
| '''DefaultXML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><create-db name='...'>([[Configuration#Database Directory|{home}input])</BaseXRepo]]create-db></code><br/>
|-
| '''SummaryPermission'''|Points to the [[Repository]], in which all XQuery modules are located.|} ===LANG==={| width='100%'|-| width='120' | '''SignatureCREATE'''|{{Code|LANG [language]}}|-| '''Default'''|{{Code|English}}
|-
| '''Summary'''
|Specifies Creates the interface languagedatabase {{Code|[name]}} with an optional {{Code|[input]}} and opens it. CurrentlyAn existing database will be overwritten.<br />The input may either be a reference to a single XML document, seven languages are available: 'English'a directory, 'German'a remote URL, 'French', 'Dutch', 'Italian', 'Japanese', and 'Vietnamese'.or a string containing XML:* {{Code|[name]}}must be a [[#Valid Names|valid database name]] ===LANGKEY==={* several additional [[Options#Create Options| width='100%'Create Options]] can be set to influence the creation process.
|-
| width='120' | '''SignatureErrors'''|{{Code|LANGKEY [boolean]}}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.
|-
| '''DefaultExamples'''|* {{Code|CREATE DB input}}<br/>creates an empty database {{Code|input}}.* {{Code|CREATE DB xmark http://files.basex.org/xml/xmark.xml}}<br/>creates the database {{Code|xmark}}, containing a single initial document called {{Code|falsexmark.xml}}.* {{Code|-CREATE DATABASE coll /path/to/input}}<br/>creates the database {{Code|coll}} with all documents found in the {{Code|input}} directory.* {{Code| SET INTPARSE false; CREATE DB input input.xml}}<br/>creates a database {{Code|input}} with {{Code|input.xml}} as initial document, which will be parsed with Java's [[Parsers#XML Parsers|default XML parser]].* <code><create-db name='simple'Summary'''><hello>Universe</hello></create-db></code><br/>creates a database named {{Code|Prefixes all texts simple}} with the internal language keys. This option is helpful if BaseX is translated into another language, and if you want to see where particular texts are displayedan initial document {{Code|<hello>Universe</hello>}}.
|}
===GLOBALLOCK=OPEN==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|GLOBALLOCK OPEN [booleanname]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><open name='...'/></code>
|-
| '''DefaultPermission'''|{{Code|false}}''READ''
|-
| '''Summary'''
|Controls Opens the database specified by {{Code|[name]}}.|-| '''Errors'''|The command fails if local (the specified database) does not exist, is currently being updated by another process or global (process) locking will cannot be used opened for managing read and write operations. The article on [[Transaction Management]] provides more details on concurrency controlsome other reason.
|}
==Client/Server ArchitectureCHECK==
===HOST===
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|HOST CHECK [hostinput]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><check input='...'/></code><br/>
|-
| '''DefaultPermission'''|{{Code|localhost}}''READ/CREATE''
|-
| '''Summary'''
|This host convenience command combines [[#OPEN|OPEN]] and [[#CREATE DB|CREATE DB]]: if a database with the name {{Code|[input]}} exists, it is used by opened. Otherwise, a new database is created; if the client when connecting specified input points to a serveran existing resource, it is stored as initial content. This option can also be changed when running the client on [[Command|-Line Options#BaseX Client| '''Errors'''|The command line]] via <code>-n</code>fails if the addressed database could neither be opened nor created.
|}
===PORT=CLOSE==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|PORT [port]CLOSE }}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><close/></code><br/>
|-
| '''DefaultPermission'''|{{Code|1984}}''READ''
|-
| '''Summary'''
|This port is used by Closes the client when connecting to a servercurrently opened database. This option can also be changed when running the client on [[Command|-Line Options#BaseX Client|'''Errors'''|The command line]] via <code>-p</code>fails if the database files could not be closed for some reason.
|}
===SERVERPORT=EXPORT==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|SERVERPORT EXPORT [portpath]}}
|-
| '''DefaultXML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|{{Code<code><export path='...'/></code><br/>|1984}}-| '''Permission'''|''CREATE''
|-
| '''Summary'''
|This is the port Exports all documents in the database server will be listening to. This option can also be changed when running the server on specified file {{Code|[path]}}, using the serializer options specified by the <code>[[Command-Line Options#BaseX ServerEXPORTER|command lineEXPORTER]] via </code>option.|-p</code>| '''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.
|}
===EVENTPORT=CREATE INDEX== 
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|EVENTPORT CREATE INDEX [portTEXT&#x7c;ATTRIBUTE&#x7c;FULLTEXT]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code>&lt;create-index type='text&#x7c;attribute&#x7c;fulltext'/&gt;</code><br/>
|-
| '''DefaultPermission'''|{{Code|1985}}''WRITE''
|-
| '''Summary'''
|This port is used by Creates the client to listen for specified database [[EventsIndexes|server eventsindex]]. It will only be bound |-| '''Errors'''|The command fails if a client attaches itself to a no database event. This option can also be changed when running is opened, if the server on [[Command-Line Options#BaseX Server|command line]] via <code>-e</code>specified index is unknown, or if indexing fails for some other reason.
|}
===USER=DROP INDEX== 
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|USER DROP INDEX [nameTEXT&#x7c;ATTRIBUTE&#x7c;FULLTEXT]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><drop-index type='text&#x7c;attribute&#x7c;fulltext'/></code><br/>
|-
| '''DefaultPermission'''|''emptyWRITE''
|-
| '''Summary'''
|Represents a user name, which is used for accessing Drops the server or an HTTP service:specified database [[Indexes|index]].|-| '''Errors'''* |The default value will be overwritten command fails if no database is opened, if a client specifies its own credentials.* If the default value specified index is emptyunknown, login will only be possible or if the client specifies credentials.* The option can also it could not be changed on [[Command-Line Options#BaseX Client|command line]] via <code>-U</code>deleted for some other reason.
|}
=Administration= =PASSWORD=ALTER DB==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|PASSWORD ALTER DB [passwordname]}}|-| '''Default'''|''empty''|-| '''Summary'''|Represents a password, which is used for accessing the server or an HTTP service:* The default value will be overwritten if a client specifies its own credentials.* If the default value is empty, login will only be possible if the client specifies credentials.* The option can also be changed on [[Command-Line Options#BaseX Client|command linenewname]] via <code>-P</code>.* Please note that it is a security risk to specify your password in plain text.|===SERVERHOST==={| width='100%'}
|-
| width='120' | 'XML&nbsp;Syntax''Signature'&nbsp;&nbsp;&nbsp;|<code><alter-db name='...' newname='...'|{{Code|SERVERHOST [host&#x7c;ip]}}/></code><br/>
|-
| '''DefaultPermission'''|''emptyCREATE''
|-
| '''Summary'''
|This is Renames the host database specified by {{Code|[name or ip address the server is bound ]}} to{{Code|[newname]}}. If the option is set to an empty string (which is the default), the server will be open to all clients.{{Code|[newname]===PROXYHOST==={} must be a [[#Valid Names| width='100%' width='100%'valid database name]].
|-
| width='120' | '''SignatureErrors'''|{{Code|PROXYHOST [host]}}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.
|-
| '''DefaultExamples'''|''empty'' * {{Code|-ALTER DB db tempdb}}<br/>renames the database {{Code| '''Summary'''db}} into {{Code|This is the host name of a proxy servertempdb}}.
|}
===PROXYPORT=DROP DB==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|PROXYPORT DROP DB [portname]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><drop-db name='...'/></code><br/>
|-
| '''DefaultPermission'''|{{Code|80}}''CREATE''
|-
| '''Summary'''
|This Drops the database with the specified {{Code|[name]}}. The [[#Glob Syntax|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 port number of a proxy serverdatabase could not be deleted for some other reason.
|}
===NONPROXYHOSTS=CREATE BACKUP==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|NONPROXYHOSTS CREATE BACKUP [hostsname]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><create-backup name='...'/></code><br/>
|-
| '''DefaultPermission'''|''emptyCREATE''
|-
| '''Summary'''
|This is Creates a list zipped backup of hosts that should the database specified by {{Code|[name]}}. The backup file will be directly accessedsuffixed with the current timestamp and stored in the database directory.The [[#Glob Syntax|} ===TIMEOUT==={| width=Glob Syntax]] can be used to address more than one database.<br/>Please note that Java 7 is required to handle ''ZIP files larger than 4 GB'100%'.
|-
| width='120' | '''SignatureErrors'''|{{Code|TIMEOUT [seconds]}}The command fails if the specified database does not exist, or if it could not be zipped for some other reason.
|-
| '''DefaultExamples'''|* {{Code|30BACKUP db}}|-| '''Summary'''|Specifies the maximum time <br/>creates a read-only transaction may take. If an operation takes longer than the specified timeout, it will be aborted. Write operations will not be affected by this timeout, as this would corrupt the integrity zip archive of the database. The timeout is deactivated if the timeout is set to {{Code|0db}}(e.g. It is ignored for {{Code|ADMINdb-2011-04-01-12-27-28.zip}} operations) in the [[Configuration#Database_Directory|database directory]].
|}
===KEEPALIVE=RESTORE==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|KEEPALIVE RESTORE [secondsname]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><restore name='...'/></code><br/>
|-
| '''DefaultPermission'''|{{Code|600}}''CREATE''
|-
| '''Summary'''
|Specifies the maximum time Restores a client will be remembered by database with the server. If there has been no interaction with a client for a longer time than specified by this timeout, it will be disconnected{{Code|[name]}}. Running operations will not be affected by this optionThe name may include the timestamp of the backup file. |-| '''Errors'''|The keepalive check is deactivated command fails if the specified backup does not exist, if the value database to be restored is set to {{Code|0}}currently locked, or if it could not be restored for some other reason.
|}
===PARALLEL=INSPECT== 
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|PARALLEL [number]INSPECT}}
|-
| '''DefaultXML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|{{Code<code><inspect/></code>|-|8}}'''Permission'''|''READ''
|-
| '''Summary'''
|Denotes Performs some integrity checks on the maximum allowed {{Code|number}} of parallel [[Transaction Management|transactions]].<br/>Note that a higher number of parallel operations may increase disk activity opened database and thus slow down queries. In some cases, returns a single transaction may even give you better results than any parallel activitybrief summary.
|}
===LOG=DROP BACKUP==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|LOG DROP BACKUP [booleanname]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><drop-backup name='...'/></code><br/>
|-
| '''DefaultPermission'''|{{Code|true}}''CREATE''
|-
| '''Summary'''
|Turns Drops all backups of the database with the specified {{Code|[[Loggingname]] of server operations and HTTP requests on/off}}. This option can also be changed when running the server on The [[Command-Line Options#BaseX ServerGlob Syntax|command lineGlob Syntax]] via <code>can be used to address more than one database.|-z| '''Examples'''|* {{Code|DROP BACKUP abc*}}<br/code>deletes the backups of all databases starting with the characters {{Code|abc}}.
|}
===LOGMSGMAXLEN=SHOW BACKUPS==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|LOGMSGMAXLEN [length]SHOW BACKUPS}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><show-backups/></code><br/>
|-
| '''DefaultPermission'''|{{Code|1000}}''CREATE''
|-
| '''Summary'''
|Specifies the maximum length of a single [[Logging|log message]]Shows all database backups.
|}
==HTTP Options== If BaseX is run as [[Web Application]], the HTTP options are either determined by the web server, or specified in the <code>[https://github.com/BaseXdb/basex-api/tree/master/src/main/webapp/WEB-INF webapp/WEB-INF]</code> directory and the {{Code|jetty.xml}} and {{Code|web.xml}} configuration files. ===WEBPATH=COPY==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|WEBPATH COPY [pathname] [newname]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><copy name='...' newname='...'/></code><br/>
|-
| '''DefaultPermission'''|<code>[[Configuration#Database Directory|{home}/BaseXWeb]]</code> or <code>[[Configuration#Database Directory|{home}/webapp]]</code>''CREATE''
|-
| '''Summary'''
|Points to the directory in which all Creates a copy of the database specified by {{Code|[name]}}. {{Code|[Web Applicationnewname]] contents are stored, including XQuery, Script, }} must be a [[RESTXQ#Valid Names|valid database name]] and configuration files.|-| '''Errors'''|The command fails if the target database already exists, or if the source database does not exist.
|}
===RESTXQPATH=INFO DB==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|RESTXQPATH [path]INFO DB}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><info-db/></code><br/>
|-
| '''DefaultPermission'''|''emptyREAD''
|-
| '''Summary'''
|Points to Shows information on the directory which contains the [[RESTXQ]] modules of a web applicationcurrently opened database. Relative paths will be resolved against the [[#WEBPATH|-| '''Errors'''|WEBPATH]] directoryThe command fails if no database is opened.
|}
===HTTPLOCAL=INFO INDEX==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|HTTPLOCAL INFO INDEX ([booleanTAG&#x7c;ATTNAME&#x7c;PATH&#x7c;TEXT&#x7c;ATTRIBUTE&#x7c;FULLTEXT])}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><info-index type='tag&#x7c;attname&#x7c;path&#x7c;text&#x7c;attribute&#x7c;fulltext'/></code><br/>
|-
| '''DefaultPermission'''|{{Code|false}}''READ''
|-
| '''Summary'''
|By default, a database server instance will Shows information on the existing [[Indexes|index]] structures. The output can be opened along with optionally limited to the web serverspecified index. If the flag is set to {{Code|-| '''Errors'''|true}}, all commands will be executed in an embedded The command fails if no database context.<br/>If BaseX is run as [[Web Application]]opened, and or if the flag is {{Code|false}}, the server will be started as soon as the first HTTP service specified index is calledunknown.
|}
===STOPPORT=INFO STORAGE==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|STOPPORT INFO STORAGE [portstart end] &#x7c; [query]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><info-storage>([query])</info-storage></code><br/>
|-
| '''DefaultPermission'''|{{Code|8985}}''READ''
|-
| '''Summary'''
|This is Shows the port on which internal main table of the [[Startup#BaseX HTTP Servercurrently opened database. An integer range or a query may be specified as argument.|HTTP Server]] can be locally closed:-* The listener for stopping the web server will only be started if the specified value is greater than {{Code|0}}.'''Errors'''* |The option is ignored command fails if BaseX no database is used as a [[Web Application]] opened, or started via [[Web Application#Maven|Maven]].* This option can also be changed when running if one of the HTTP server on [[Command-Line Options#BaseX Server|command line]] via <code>-s</code>specified arguments is invalid.
|}
=Create OptionsQuerying =
==GeneralLIST==
===MAINMEM===
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|MAINMEM LIST ([booleanname]([path]))}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><list (name='...' (path='...'))/></code><br/>
|-
| '''DefaultPermission'''|{{Code|false}}''NONE''
|-
| '''Summary'''
|Lists all available databases. If this option {{Code|[name]}} is turned onspecified, new databases will be exclusively created in main memorythe resources of a database are listed. Most queries will The output can be evaluated faster in main memory mode, but all data is lost if BaseX is shut downfurther restricted to the resources matching the specified {{Code|[path]}}. |-| '''Errors'''|The value of this option will command fails if the optional database cannot be assigned once to a new databaseopened, and or if the existing databases cannot be changed after thatlisted for some other reason.
|}
==XQUERY=ADDCACHE=== 
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|ADDCACHE XQUERY [booleanquery]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><xquery>[query]</xquery></code><br/>
|-
| '''DefaultPermission'''|{{Code|false}}''depends on query''
|-
| '''Summary'''
|If this option is activated, documents that are added via [Runs the specified {{Code|[Commands#ADD|ADDquery]] will first be cached to disk before being added to the final database. This option is helpful when larger documents are to be imported, }} and if prints the existing heuristics cannot estimate the size of the input (eresult.g. when adding directories).|} ==Parsing== ===CREATEFILTER==={| width='100%'
|-
| width='120' | '''SignatureErrors'''|{{Code|CREATEFILTER [filter]}}The command fails if the specified query is invalid.
|-
| '''DefaultExamples'''|* {{Code|*.xmlXQUERY 1 to 10}}<br/>returns the sequence {{Code|-(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)}}.* {{Code| '''Summary'''SET RUNS 10; XQUERY 1 to 10}}<br/>runs the query 10 times, returns the result and prints the average execution time.* {{Code|File filter in SET XMLPLAN true; XQUERY 1 to 10}}<br/>returns the [[Commands#Glob Syntax|Glob Syntax]], which is applied whenever new databases are created, or resources are added to a databaseresult and prints the query plan as XML.
|}
===ADDARCHIVES=RETRIEVE==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|ADDARCHIVES RETRIEVE [booleanpath]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><retrieve path='...'/></code><br/>
|-
| '''DefaultPermission'''|{{Code|true}}''READ''
|-
| '''Summary'''
|If this option is set to Retrieves a raw file from the opened database at the specified {{Code|true[path]}}, files within archives (ZIP, GZIP, DOCX, etc.) are parsed whenever new |-| '''Errors'''|The command fails if no database are created is opened, if the source path is invalid or resources are added to a databaseif the data cannot not be retrieved for some other reason.
|}
===SKIPCORRUPT=FIND==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|SKIPCORRUPT FIND [booleanquery]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><find>[query]</find></code><br/>
|-
| '''DefaultPermission'''|{{Code|false}}''READ''
|-
| '''Summary'''
|Skips corrupt (iBuilds and runs a query for the specified {{Code|[query]}} terms.eKeywords can be enclosed in quotes to look for phrases., not wellThe 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|-formed) files while creating a | '''Errors'''|The command fails if no database or adding new documents. If this option is activated, document updates are slowed down, as all files will be parsed twice. Next, main memory consumption will be higher as parsed files will be cached in main memoryopened.
|}
===ADDRAW=CS==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|ADDRAW CS [booleanquery]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><cs>[query]</cs></code><br/>
|-
| '''DefaultPermission'''|{{Code|false}}''depends on query''
|-
| '''Summary'''
|If this option is activated, and if new resources are added to a database, all files that are not filtered by Evaluates the specified {{Code|[[#CREATEFILTER|CREATEFILTERquery]] option will be added }} and declares the resulting nodes as new ''rawcontext set'' files . In subsequent queries, the context set will be available via the context item expression of XQuery (i{{Code|.e}}).|-| '''Errors'''|The command fails if no database is opened, in their binary representation)if the specified query is invalid or if it does not return nodes of the currently opened database.
|}
===PARSER=REPO INSTALL==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|PARSER REPO INSTALL [typepath]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><repo-install path='...'/></code><br/>
|-
| '''DefaultPermission'''|{{Code|XML}}''CREATE''
|-
| '''Summary'''
|Defines a [Installs the package with path {{Code|[Parsers|parserpath]] for importing new files to the database}}. Currently, |-| 'XML', 'JSONErrors', 'CSV', 'TEXT', 'HTML' are available as parsers| The command fails in the following cases:* The package to be installed is not a xar file. HTML will * The package to be parsed as normal XML files if [http://homeinstalled does not exist or is already installed.ccil* The package descriptor is with invalid syntax.org/~cowan/XML/tagsoup/ Tagsoup] * The package to be installed depends on a package which is not installed.* The package is not found in supported by the current version of BaseX.* A component of the classpathpackage is already installed as part of another package.
|}
==REPO LIST=CSVPARSER=== Introduced with {{Mark|Version 7.8:}} 
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|CSVPARSER [options]REPO LIST}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><repo-list/></code><br/>
|-
| '''DefaultPermission'''|''emptyREAD''
|-
| '''Summary'''
|Specifies the way how CSV data is to be parsed. The available options are listed in the [[CSV Module#Options|CSV Module]]Lists all installed packages.
|}
==REPO DELETE=JSONPARSER=== Introduced with {{Mark|Version 7.8:}} 
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|JSONPARSER REPO DELETE [optionsname]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><repo-delete name='...'/></code><br/>
|-
| '''DefaultPermission'''|''emptyCREATE''
|-
| '''Summary'''
|Specifies Deletes the way how JSON data is package with name {{Code|[name]}}, optionally followed by a version.|-| '''Errors'''| The command fails if the package to be parsed. The available options are listed deleted participates in the [[JSON Module#Options|JSON Module]]a dependency.
|}
=Updates==TEXTPARSER=== Introduced with {{Mark|Version 7.8:}}
==ADD==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|TEXTPARSER ADD (TO [optionspath]) [input]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><add (path='...')>[input]</add></code><br/>
|-
| '''DefaultPermission'''|''emptyWRITE''
|-
| '''Summary'''
|Specifies Adds a file, directory or XML string specified by {{Code|[input]}} to the currently opened database at the way how TEXT data is to be parsedspecified {{Code|[path]}}. Available options are listed A document with the same path may occur than once in the article on a database. If this is unwanted, [[Parsers#REPLACE|REPLACE]]can be used.<br/>{{Code|[input]==} may either be a single XML Parsing== ===CHOP==={| width='100%'document, a directory, a remote URL or a plain XML string.
|-
| width='120' | '''SignatureErrors'''|{{Code|CHOP [boolean]}}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.
|-
| '''DefaultExamples'''|* {{Code|trueADD input.xml}}<br/>adds the file {{Code|-input.xml}} to the database.* {{Code| '''Summary'''ADD TO temp/one.xml input.xml}}<br/>adds {{Code|Chops all leading and trailing whitespaces from text nodes while building a input.xml}} to the database, and discards empty text nodes. By default, this option is set moves it to {{Code|truetemp/one.xml}}, as it often reduces the database size by up to 50%. It can also be turned off on [[Command-Line Options#BaseX Standalone* {{Code|command line]] via <code>-wADD TO target/ xmldir}}<br/code>adds all files from the {{Code|xmldir}} directory to the database in the {{Code|target}} path.
|}
==DELETE=INTPARSE=== {{Mark|Updated with Version 7.8}}: default is now {{Code|false}}. 
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|INTPARSE DELETE [booleanpath]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><delete path='...'/></code><br/>
|-
| '''DefaultPermission'''|{{Code|false}}''WRITE''
|-
| '''Summary'''
|Uses Deletes all documents from the internal XML parser instead of currently opened database that start with the standard Java XML parserspecified {{Code|[path]}}. |-| '''Errors'''|The internal parser command fails if no database is faster, more fault tolerant and supports common HTML entities out-of-the-box, but it does not support all features needed for parsing DTDsopened.
|}
===DTD=RENAME==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|DTD RENAME [booleanpath] [newpath]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><rename path='...' newpath='...'/></code><br/>
|-
| '''DefaultPermission'''|{{Code|false}}''WRITE''
|-
| '''Summary'''
|Parses referenced DTDs and resolves XML entities. By default, this option is switched to Renames all document paths in the currently opened database that start with the specified {{Code|false[path]}}, as many DTDs are located externally, which may completely block the process of creating new databases. The [[#CATFILE|CATFILE]] option can command may be changed used to locally resolve DTDseither rename single documents or directories.|} ===CATFILE==={| width='100%'
|-
| width='120' | '''SignatureErrors'''|{{Code|CATFILE [The command fails if no database is opened, or if the target path]}}is empty.
|-
| '''DefaultExamples'''|''empty''* {{Code|-RENAME one.xml two.xml}}<br/>renames the document {{Code|one.xml}} to {{Code| '''Summary'''two.xml}}.* {{Code|Specifies RENAME / TOP}}<br/>moves all documents to a catalog file to locally resolve DTDs; see the entry on [[Catalog Resolver]]s for more details{{Code|TOP}} root directory.
|}
==Indexing== The current index and full-text index options will be stored in a new database, and take effect if indexes are rebuilt via the [[Commands#OPTIMIZE|OPTIMIZE]]. ===TEXTINDEX=REPLACE==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|TEXTINDEX REPLACE [booleanpath] [input]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><replace path='...'>[input]</replace></code><br/>
|-
| '''DefaultPermission'''|{{Code|true}}''WRITE''
|-
| '''Summary'''
|Creates Replaces a text index whenever a new document in the currently opened database is created. A text index speeds up queries with equality comparisons on text nodes; see , addressed by {{Code|[[Indexespath]] for more details.|===ATTRINDEX===}, with the file or XML string specified by {{Code| width='100%'[input]}}, or adds a new document if the resource does not exist yet.
|-
| width='120' | '''SignatureErrors'''|{{Code|ATTRINDEX [boolean]}}The command fails if no database is opened, if the specified path points to a database directory, or if the input is not found.
|-
| '''DefaultExamples'''|* {{Code|REPLACE one.xml input.xml}}<br/>replaces the document {{Code|trueone.xml}}with the contents of the file {{Code|-input.xml}}.* {{Code| '''Summary'''REPLACE top.xml &lt;xml/&gt;}}<br/>replaces the document {{Code|Creates an attribute index whenever a new database is createdtop. An attribute index speeds up queries xml}} with equality comparisons on attribute valuesthe document {{Code|&lt; see [[Indexes]] for more detailsxml/&gt;}}.
|}
===FTINDEX=STORE==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|FTINDEX STORE (TO [booleanpath]) [input]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><store (path='...')>[input]</store></code><br/>
|-
| '''DefaultPermission'''|{{Code|false}}''WRITE''
|-
| '''Summary'''
|Creates Stores a full-text index whenever raw file in the opened database to the specified {{Code|[path]}}. {{Code|[input]}} may either be a file reference, a remote URL, or a new database is createdplain string. A full-text index speeds up queries If the path denotes a directory, it needs to be suffixed with fulla slash ({{Code|/}}).|-text expressions; see [[Indexes]] | '''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 more detailssome other reason.
|}
===MAXLEN=OPTIMIZE==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|MAXLEN [int]OPTIMIZE (ALL)}}
|-
| '''DefaultXML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|{{Code<code><optimize/></code><br/><code><optimize-all/></code><br/>|-|96}}'''Permission'''|''WRITE''
|-
| '''Summary'''
|Specifies Optimizes the maximum length index structures, meta data and statistics of strings that are to be indexed by the namecurrently opened database. If the {{Code|ALL}} flag is specified, path, value, and full-text index the internal database structures. The value of are completely rebuilt; this option will be assigned once often leads to a new reduction of the total databasesize.|-| '''Errors'''|The command fails if no database is opened, and cannot be changed after thator if the currently opened database is a main-memory instance.
|}
===MAXCATS=FLUSH==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|MAXCATS [int]FLUSH}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><flush/></code><br/>
|-
| '''DefaultPermission'''|{{Code|100}}''WRITE''
|-
| '''Summary'''
|Specifies Explicitly flushes the maximum number buffers of distinct values (categories) that will be stored together with the element/attribute names or unique paths in the currently opened database to disk. This command is applied if [[IndexOptions#Name IndexAUTOFLUSH|Name IndexAUTOFLUSH]] or [[Index#Path Index|Path Index]]. The value of this option will be assigned once has been set to a new database, and cannot be changed after that.|} ===UPDINDEX==={| width='100%'|-| width='120' | '''Signature'''|{{Code|UPDINDEX [boolean]}}|-| '''Default'''|{{Code|false}}.
|-
| '''SummaryErrors'''|If turned on, incremental indexing will be activated:* with each update, the text and attribute value indexes will be updated as well.* The value of this option will be assigned once to a new command fails if no database, and cannot be changed after that.* The advantage of incremental indexes is that the value index structures will always be up-to-date.* The downside is that updates will take longer. The article on [[Index#Updates|Index Structures]] includes additional detailsopened.
|}
===INDEXSPLITSIZE==Server Administration=
==SHOW SESSIONS==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|INDEXSPLITSIZE [num]SHOW SESSIONS}}
|-
| '''DefaultXML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|{{Code<code><show-sessions/></code><br/>|-|0}}'''Permission'''|''ADMIN''
|-
| '''Summary'''
|This option affects the [[Indexes#Index Construction|construction]] of new text and attribute indexes. It specifies the number of index build operations Shows all sessions that are performed before writing partial index data connected to disk. By default, if the value is set to 0, some dynamic split heuristics are appliedcurrent server instance.
|}
==SHOW USERS=FTINDEXSPLITSIZE=== 
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|FTINDEXSPLITSIZE SHOW USERS (ON [numdatabase])}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><show-users (database='...')/></code><br/>
|-
| '''DefaultPermission'''|{{Code|0}}''ADMIN''
|-
| '''Summary'''
|This option affects Shows all users that are registered in the database. If a {{Code|[[Indexes#Index Construction|constructiondatabase]] of new full-text indexes. It specifies the number of index build operations that }} is specified, local users are performed before writing partial index data to diskshown. By default, |-| '''Errors'''|The command fails if the value is set to 0, some dynamic split heuristics are appliedoptional database could not be opened.
|}
==Full-Text== ===STEMMING=KILL==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|STEMMING KILL [booleantarget]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><kill target='...'/></code><br/>
|-
| '''DefaultPermission'''|{{Code|false}}''ADMIN''
|-
| '''Summary'''
|A new full-text index will stem all tokens and speed up queries on stemmed tokensKills sessions of a user or an IP:port combination, specified by {{Code|[target]}}. The same stemming normalization will [[#Glob Syntax|Glob Syntax]] can be applied used to address more than one user.|-| '''Errors'''|The command fails if a user tried to all query tokens that are checked against tokens in this indexkill his/her own session.
|}
===CASESENS=CREATE EVENT==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|CASESENS CREATE EVENT [booleanNAME]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><create-event name='...'/></code><br/>
|-
| '''DefaultPermission'''|{{Code|false}}''ADMIN''
|-
| '''Summary'''
|A new full-text index will preserve Creates the case of all tokensspecified [[Events|event]]. |-| '''Errors'''|The same case normalization will be applied to all query tokens that are checked against tokens in this indexcommand fails if event already exists.
|}
===DIACRITICS=SHOW EVENTS==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|DIACRITICS [boolean]SHOW EVENTS}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><show-events/></code><br/>
|-
| '''DefaultPermission'''|{{Code|false}}''ADMIN''
|-
| '''Summary'''
|A new full-text index will preserve the diacritics of Shows all tokens. The same diacritics normalization will be applied to all query tokens [[Events|events]] that are checked against tokens have been registered in this indexthe database.
|}
===LANGUAGE=DROP EVENT==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|LANGUAGE DROP EVENT [langNAME]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><drop-event name='...'/></code><br/>
|-
| '''DefaultPermission'''|{{Code|en}}''ADMIN''
|-
| '''Summary'''
|A new full-text index will use Drops the given language to normalize all tokens. This option is mainly important if tokens are to be stemmed, or if the tokenization of a language differs from Western languages.specified [[Events|} ===STOPWORDS==={| width='100%'|-| width='120' | '''Signature'''|{{Code|STOPWORDS [pathevent]]}}.
|-
| '''DefaultErrors'''|The command fails if the event doesn''empty''|-| '''Summary'''|A new full-text index will drop tokens that are listed in the specified stopword list. A stopword list may decrease the size of the full text index. A standard stopword list for English texts is provided in the directory {{Code|etc/stopwords.txt}} in the official releasest exist.
|}
=Query OptionsUser Management=
===QUERYINFO=CREATE USER==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|QUERYINFO CREATE USER [booleanname]([password])}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><create-user name='...'>([password])</create-user></code><br/>
|-
| '''DefaultPermission'''|{{Code|false}}''ADMIN''
|-
| '''Summary'''
|Prints more information on internal query rewritings, optimizations, Creates a user with the specified {{Code|[name]}} and performance{{Code|[password]}}. By default, this info is shown in the {{Code|[name]}} must be a [[GUI#VisualizationsValid Names|Info Viewvalid user name]] . The password must be a valid MD5 hash value. If no password is specified in the GUIconsole mode, it is requested via standard input. It can also be activated on [[Command|-Line Options#BaseX Standalone| '''Errors'''|The command line]] via <code>-V</code>fails if the specified user already exists, or if the password is no valid MD5 hash value.
|}
===XQUERY3=ALTER USER==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|XQUERY3ALTER USER [name] ([password])}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><alter-user name='...'>([password])</alter-user></code><br/>
|-
| '''DefaultPermission'''|{{Code|true}}''ADMIN''
|-
| '''Summary'''
|Enables all [Alters the {{Code|[XQuery 3.0password]] features supported }} of the user specified by BaseX. If this option is set to {{Code|false[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 XQuery parser will only accept expressions of specified user does not exist, or if the XQuery 1.0 specificationpassword is no valid MD5 hash value.
|}
===BINDINGS=DROP USER==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|BINDINGS DROP USER [varsname](ON [database])}}:|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><drop-user name='...' (database='...')/></code><br/>
|-
| '''DefaultPermission'''|''emptyADMIN''
|-
| '''Summary'''
|Contains external variables to be bound to a query:* Variable names and values are separated by equality signs, and multiple variables are delimited by commas.* Variables may optionally be introduced Drops the user with a leading dollar sign.* Commas that occur in the value itself are encoded by duplicationspecified {{Code|[name]}}.* If a variable uses a namespace different to the default namespace{{Code|[database]}} is specified, it can be specified with the user is only dropped locally. The [http://www.jclark.com/xml/xmlns.htm Clark Notation] or [http://www.w3.org/TR/xquery-30/#id-basics Expanded QName NotationGlob Syntax|Glob Syntax]].* This option can also be used on [[Command-Line Options#BaseX Standalone|command line]] with the flag <code>-b</code>to address more than one database or user.
|-
| '''ExamplesErrors'''|<code>$a=1,$b=2</code> &nbsp; binds the values The command fails if {{Code|1admin}} and {{Code|2}} to the variables $a and $b<br/> <code>a=1,is specified as user name,2</code> &nbsp; binds if the value {{Code|1specified user does not exist or is logged in,2}} to the variable $a<br/> <code>{URI}a=x</code> &nbsp; binds or if the value {{Code|x}} to the variable $a with the namespace {{Code|URI}}. <pre class="brush:xml">SET BINDINGS BIND-VAR="hello world!"XQUERY declare variable $BIND-VAR external; $BIND-VAR</pre> &nbsp; binds the value {{Code|hello world!}} to the variable $BIND-VAR and shows how it can optional database could not be used in a [[Commands#Command_Scripts| Command Script]]opened for modification
|}
===QUERYPATH=GRANT==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|QUERYPATH GRANT [pathNONE&#x7c;READ&#x7c;WRITE&#x7c;CREATE&#x7c;ADMIN]}}|-| '''Default'''|''empty''|-| '''Summary'''|Contains the path (''base URI''ON [database]) to the executed query (default: ''empty''). This directory will be used to resolve relative paths to documents, query modules, and other resources addressed in a query.|TO [user]===INLINELIMIT=== {{Mark|Introduced with Version 7.8:}} {| width='100%'
|-
| width='120' 'XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;| <code><grant name='...'permission='Signaturenone&#x7c;read&#x7c;write&#x7c;create&#x7c;admin'(database='...'|{{Code|INLINELIMIT}})/></code><br/>
|-
| '''DefaultPermission'''|{{Code|100}}''ADMIN''
|-
| '''Summary'''
|Specifies Grants the maximum size specified [[User_Management|permission]] to the body of a function may have in order to be inlined. Function inlining can be turned off by setting this value to specified {{Code|-1[user]}}.|} ===TAILCALLS=== If a {{MarkCode|Introduced with Version 7.8:[database]}} {is specified, the permissions are only granted locally. The [[#Glob Syntax| width='100%'Glob Syntax]] can be used to address more than one database or user.
|-
| width='120' | '''SignatureErrors'''|The command fails if {{Code|TAILCALLSadmin}}is specified as user name, if the specified user does not exist, or if the optional database could not be opened for modification.
|-
| '''DefaultExamples'''|* {{Code|256GRANT READ TO JoeWinson}}<br/>grants {{Code|-READ}} permission to the user {{Code| '''Summary'''JoeWinson}}.* {{Code|Specifies how many stack frames of [http:GRANT WRITE ON Wiki TO editor*}}<br//en.wikipedia.org/wiki/Tail_call tail-calls] are allowed >grants {{Code|WRITE}} permissions on the stack at any time. When this limit is reached, tail-call optimization takes place and some call frames are eliminated. The feature can be turned off by setting {{Code|Wiki}} database to all users starting with the value to characters {{Code|-1editor*}}.
|}
==PASSWORD=DEFAULTDB=== {{Mark|Introduced with Version 7.8:}} 
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|DEFAULTDB}}|-| '''Default'''|{{Code|false}}|-| '''Summary'''|If this option is turned on, paths specified in the {{Code|fn:doc}} and {{Code|fn:collections}} functions will first be resolved against a database that has been opened in the global context outside the query PASSWORD (e.g. by the [[Commands#OPEN|OPENpassword]] command). If the path does not match any existing resources, it will be resolved as described in the article on [[Databases#Access Resources|accessing database resources]].|===CACHEQUERY==={| width='100%'}
|-
| width='120' | '''SignatureXML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|{{Code|CACHEQUERY <code><password>([booleanpassword]}})</password></code><br/>
|-
| '''DefaultPermission'''|{{Code|false}}''NONE''
|-
| '''Summary'''
|Caches Changes the query results before returning them to the client. This option may be set to {{Code|true[password]}} if of the whole result is needed for further operations (such as is ecurrent user.gThe password must be a valid MD5 hash value. the case If no password is specified in the GUI of BaseX)console mode, it is requested via standard input.|} ===FORCECREATE==={| width='100%'|-| width='120' | '''Signature'''|{{Code|FORCECREATE [boolean]}}|-| '''Default'''|{{Code|false}}
|-
| '''SummaryErrors'''|By activating this option, The command fails if the XQuery {{Code|doc()}} and {{Code|collection()}} functions will create database instances for the addressed input filespassword is no valid MD5 hash value.
|}
===CHECKSTRINGS==General Commands=
==RUN==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|CHECKSTRINGS RUN [booleanfile]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><run file='...'/></code>
|-
| '''DefaultPermission'''|{{Code|true}}''depends on input''
|-
| '''Summary'''
|If this option is turned off, strings from external sources will be adopted as is, i. e., without being checked for valid XML characters:* This option affects [[Java Bindings]] and Evaluates the string conversion and input functions [[Archive Module#archive:createcontents of {{Code|archive:create]], [[Archive Module#archive:extract-text|archive:extract-textfile]], [[Archive Module#archive:update}} as XQuery expression. If the file ends with the suffix {{Code|archive:update]].bxs}}, [[Conversion Module#convert:binary-to-string|convert:binary-to-string]], [[Fetch Module#fetch:text|fetch:text]], [[File Module#the file:read-text|file:read-text]], and content will be evaluated as [[ZIP Module#zip:text-entryBasics|zip:text-entrycommand script]].* Please This command can be aware that an inconsiderate use of this option may cause unexpected behavior when storing or outputting stringsused to run several commands in a single transaction.|} ===LSERROR==={| width='100%'
|-
| width='120' | '''SignatureErrors'''|{{Code|LSERROR [error]}}The command fails if the specified file does not exist, or if the retrieved input is invalid. It will be canceled as soon as one of the executed commands fails.
|-
| '''DefaultExamples'''|{{Code|0}}|-* <code>RUN query.xq</code><br/>will evaluated the specified file as XQuery expression| '''Summary'''|This option specifies the maximum Levenshtein error for the BaseX-specific fuzzy match option* <code>RUN commands. See bxs</code><br/>will evaluated the page on [[Full-Text#Fuzzy_Querying|Full-Texts]] for more information on fuzzy querying.specified file as command script
|}
==EXECUTE=RUNQUERY=== {{Mark|Introduced with Version 7.8:}}
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|RUNQUERY EXECUTE [booleaninput]}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><execute>[input]</execute></code>
|-
| '''DefaultPermission'''|{{Code|true}}''depends on input''
|-
| '''Summary'''
|Specifies if a query will be executed or parsed only. This option can also be changed on Evaluates the specified {{Code|[input]}} as [[Command-Line Options#BaseX StandaloneBasics|command linescript]] via <code>-R</code>.|} ===RUNS==={| width='100%'This command can be used to run several commands in a single transaction.
|-
| width='120' | '''SignatureErrors'''|{{Code|RUNS [num]}}The command fails if the syntax of the specified input is invalid. It will be canceled as soon as one of the executed commands fails.
|-
| '''DefaultExamples'''|{{Code|1}}|* <code>EXECUTE "create db db1; create db db2"</code><br/>* <code>EXECUTE "<commands><create-| db name='db1'/><create-db name='Summarydb2'''|Specifies how often a query will be evaluated. The result is serialized only once, and the measured times are averages of all runs. This option can also be changed on [[Command-Line Options#BaseX Standalone|command line]] via /></commands>"</code>-r<br/code>both commands will create two databases {{Code|db1}} and {{Code|db2}} in a single transaction.
|}
=Serialization Options= ===SERIALIZE=GET==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|SERIALIZE GET [booleanoption]}}|-| '''Default'''|{{Code|true}}|-| '''Summary'''|Results of XQuery expressions will be serialized if this option is turned on. For debugging purposes and performance measurements, this option can be set to {{Code|false}}. It can also be turned off on [[Command-Line Options#BaseX Standalone|command line]] via <code>-z</code>. |} ===SERIALIZER==={| width='100%'
|-
| width='120' | 'XML&nbsp;Syntax''Signature'&nbsp;&nbsp;&nbsp;|<code><get option='...'|{{Code|SERIALIZER [params]}}/></code><br/>
|-
| '''DefaultPermission'''|''emptyNONE''
|-
| '''Summary'''
|Contains parameters for Returns the current value of the [[SerializationOptions|serializingOption]] query results:* Keys and values are separated by equality signsspecified via {{Code|[option]}}.* Multiple parameters are delimited by commas.* The option Global options can also only be used on [[Command-Line Options#BaseX Standalone|command line]] requested by users with the flag <code>-s</code>ADMIN permissions.
|-
| '''ExampleErrors'''|<code>encoding=US-ASCII,omit-xml-declaration=no</code> : sets The command fails if the encoding to {{Code|US-ASCII}} and prints the XML declarationspecified option is unknown.
|}
===EXPORTER=SET==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|EXPORTER SET [paramsoption]([value])}}|-| '''XML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|<code><set option='...'>([value])</set></code><br/>
|-
| '''DefaultPermission'''|''emptyNONE''
|-
| '''Summary'''
|Contains parameters for exporting all resources of a database; see Sets the [[Options|Option]] specified by {{Code|[Serializationoption]}} to a new {{Code|[value] for more details}}. Keys Only local options can be modified. If no value is specified, and values are separated by equality signsif the value is boolean, multiple parameters are delimited by commasit will be inverted.|-| '''Errors'''|The command fails if the specified option is unknown or if the specified value is invalid.
|}
===XMLPLAN=INFO==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|XMLPLAN [boolean]INFO}}|-| '''Default'''|{{Code|false}}|-| '''Summary'''|Prints the execution plan of an XQuery expression in its XML representation. This option can also be activated on [[Command-Line Options#BaseX Standalone|command line]] via <code>-x</code>. |} ===COMPPLAN==={| width='100%'
|-
| width='120' | '''SignatureXML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|{{Code|COMPPLAN [boolean]}}<code><info/></code><br/>
|-
| '''DefaultPermission'''|{{Code|true}}''READ''
|-
| '''Summary'''
|Creates the query plan before or after query compilation. Query plans might change due to optimizationsShows global information.
|}
===DOTPLAN=HELP==
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|DOTPLAN HELP ([booleancommand])}}|-| '''Default'''|{{Code|false}}|-| '''Summary'''|Visualizes the execution plan of an XQuery expression with [http://www.graphviz.org dotty] and saves its dot file in the query directory.|} ===DOTCOMPACT==={| width='100%'
|-
| width='120' | '''SignatureXML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|{{Code|DOTCOMPACT <code><help>([booleancommand]}})</help></code><br/>
|-
| '''DefaultPermission'''|{{Code|false}}''NONE''
|-
| '''Summary'''
|Chooses a compact dot representation.|} =Other Options= ===AUTOFLUSH==={| width='100%'|-| width='120' | '''Signature'''|If {{Code|AUTOFLUSH [booleancommand]}}|-| '''Default'''|{{Code|true}}is specified, information on the specific command is printed; otherwise, all commands are listed.
|-
| '''SummaryErrors'''|Flushes database buffers to disk after each update. If this option is set to {{Code|false}}, bulk operations (multiple single updates) will be evaluated faster. As a drawback, the chance of data loss increases The command fails if the database specified command is not explicitly flushed via the [[Commands#FLUSH|FLUSH]] commandunknown.
|}
==EXIT=WRITEBACK=== {{Mark|Updated with Version 7.8:}} only applies to main-memory document instances. 
{| width='100%'
|-
| width='120130' | '''SignatureSyntax'''|{{Code|WRITEBACK [boolean]EXIT }}|-| '''Default'''|{{Code|false}}|-| '''Summary'''|Propagates updates on main-memory instances of files that have been retrieved via {{Code|fn:doc}} or {{Code|fn:collection}} back to disk. No backups of your original files will be created if this option is turned on. This option can also be activated on [[Command-Line Options#BaseX Standalone|command line]] via <code>-u</code>.|} ===MAXSTAT==={| width='100%'
|-
| width='120' | '''SignatureXML&nbsp;Syntax'''&nbsp;&nbsp;&nbsp;|{{Code|MAXSTAT [num]}}<code><exit/></code><br/>
|-
| '''DefaultPermission'''|{{Code|30}}''NONE''
|-
| '''Summary'''
|Specifies Exits the maximum number of index occurrences printed by the <code>[[Commands#INFO|INFO INDEX]]</code> commandconsole mode.
|}
=Changelog=
 
;Version 7.8
 
* Added: <code>[[#CSVPARSER|CSVPARSER]]</code>, <code>[[#JSONPARSER|JSONPARSER]]</code>, <code>[[#TEXTPARSER|TEXTPARSER]]</code>, <code>[[#HTMLPARSER|HTMLPARSER]]</code>, <code>[[#INLINELIMIT|INLINELIMIT]]</code>, <code>[[#TAILCALLS|TAILCALLS]]</code>, <code>[[#DEFAULTDB|DEFAULTDB]]</code>, <code>[[#RUNQUERY|RUNQUERY]]</code>
* Updated: <code>[[#WRITEBACK|WRITEBACK]]</code> only applies to main-memory document instances.
* Updated: <code>[[#DEBUG|DEBUG]]</code> option can be changed at runtime by users with admin permissions.
* Updated: default of <code>[[#INTPARSE|INTPARSE]]</code> is now {{Code|false}}.
* Removed: <code>HTMLOPT</code> (replaced with <code>[[#HTMLPARSER|HTMLPARSER]]</code>), <code>PARSEROPT</code> (replaced with parser-specific options), <code>DOTDISPLAY</code>, <code>DOTTY</code>
;Version 7.7
* AddedUpdated: <code>syntax of [[#ADDCACHEValid Names|ADDCACHEvalid names]]</code>, <code>[[#CHECKSTRINGS|CHECKSTRINGS]]</code>, <code>[[#FTINDEXSPLITSIZE|FTINDEXSPLITSIZE]]</code>, <code>[[#INDEXSPLITSIZE|INDEXSPLITSIZE]]</code>
;Version 7.65
* Added: <code>[[#GLOBALLOCKEXECUTE|GLOBALLOCKEXECUTE]]</code>executes a command script* Added: store local options in configuration file after <code>[[#INSPECT|INSPECT]]</code> performs integrity checks* Added: automatic detection of [[#Basics|Command Scripts]]* Removed: {{Code|# Local OptionsSHOW DATABASES}} comments.; information is also returned by <code>[[#SHOW SESSIONS|SHOW SESSIONS]]</code>* Removed: <code>[[#OPEN|OPEN]]</code>: path argument
;Version 7.53
* Added: options can now be set via system properties* Added: a pragma expression can be used to locally change database options* Added: <code>[[#USERXML Syntax|USERXML Syntax]]</code>, added* Updated: <code>[[#PASSWORDCHECK|PASSWORDCHECK]]</code>, can now be used to create empty databases* Updated: Names and paths in <code>[[#LOGOPEN|LOGOPEN]]</code>, and <code>[[#LOGMSGMAXLENLIST|LOGMSGMAXLENLIST]]</code>, <code>[[#WEBPATH|WEBPATH]]</code>, <code>[[#RESTXQPATH|RESTXQPATH]]</code><code>[[#HTTPLOCAL|HTTPLOCAL]]</code>, <code>[[#CREATEONLY|CREATEONLY]]</code>, <code>[[#STRIPNS|STRIPNS]]</code>* Removed: {{Code|HTTPPATH}}; {{Code|HTTPPORT}}: {{Code|jetty.xml}} configuration file is used instead* Removed: global options cannot be changed anymore during the lifetime of a BaseX instanceare now specified as separate arguments
;Version 7.32.1
* Updated: permissions for <code>[[#KEEPALIVEGET|KEEPALIVEGET]]</code>, and <code>[[#TIMEOUTSET|TIMEOUTSET]]</code>: default values changed* Removed: from {{Code|WILDCARDSREAD}}; new index supports both fuzzy and wildcard queries* Removed: to {{Code|SCORINGNONE}}; new scoring model will focus on lengths of text nodes and match options
;Version 7.2
* AddedUpdated: <code>[[#PROXYHOSTCREATE INDEX|PROXYHOSTCREATE INDEX]]</code>, <code>[[#PROXYPORTDROP INDEX|PROXYPORTDROP INDEX]]</code>, ({{Code|PATH}} argument removed. Path summary is always available now and updated with [[#OPTIMIZE|OPTIMIZE]])* Updated: permissions for <code>[[#NONPROXYHOSTSREPO DELETE|NONPROXYHOSTSREPO DELETE]]</code>, <code>[[#HTMLOPTREPO INSTALL|HTMLOPTREPO INSTALL]]</code>* Updated: and <code>[[#TIMEOUTREPO LIST|TIMEOUTREPO LIST]]</code>: ignore timeout for admin users
;Version 7.1
* AddedUpdated: <code>[[#ADDRAW|ADDRAW]]</code>, <code>[[#MAXLEN|MAXLEN]]</code>, <code>[[#MAXCATS|MAXCATS]]</code>, <code>[[#UPDINDEXKILL|UPDINDEXKILL]]</code>* Updated(killing sessions by specifying IP: <code>[[#BINDINGS|BINDINGS]]</code>port)
;Version 7.0
* Added: <code>[[#SERVERHOSTFLUSH|SERVERHOSTFLUSH]]</code>, <code>[[#KEEPALIVERETRIEVE|KEEPALIVERETRIEVE]]</code>, <code>[[#AUTOFLUSHSTORE|AUTOFLUSHSTORE]]</code>, * Updated: <code>[[#QUERYPATHADD|QUERYPATHADD]]</code>: simplified arguments [[Category:Beginner]][[Category:Server]]
administrator, Bureaucrats, editor, reviewer, Administrators
57

edits

Navigation menu