Changes

Jump to navigation Jump to search
297 bytes added ,  13:19, 24 May 2018
no edit summary
It gives more details on the command-line options of all BaseX [[Startup]] modes.
Options can be specified multiple times. All Please note that all options are will be evaluated in the given order (in earlier versions, the sequential evaluation was limited to the specified inputs, query files, queries and commands, while all other options were initially set). The standard input can be parsed by specifying a single dash ({{Code|-}}) as argument. =Standalone=
=BaseX Standalone=
;Launch the console mode:
<pre>
-c<input> Execute commands from file or string
-d Activate debugging mode
-i<input> Open initial XML file or database -L Append newlines I<input> Assign input string to query resultscontext
-o<output> Write output to file
-q<expr> Execute XQuery expression
-R Turn query execution on/off
-s<pars> Set serialization parameter(s)
-t[path] Run tests in file or directory
-u Write updates back to original files
-v/V Show (all) process info
</pre>
The meaning of all flags is listed in the following table. If an equivalent database option exists (which can be specified via the <code>[[Commands#SET|SET]] </code> command), it is listed as well. For the examples to work escaping some characters might be necessary, depending on your Operating System.
{| class="wikitable"
| {{Code|[input]}}
|Evaluates the specified input:
* The input string may point to an existing file. If the file suffix is {{Code|.bxs}}, the file content contents will be evaluated as [[Commands#Basics|Command Script]]; otherwise, it will be evaluated as XQuery expression.
* Otherwise, the input string itself is evaluated as XQuery expression.
|
| <code>[[Options#BINDINGS|BINDINGS]]</code>
|
|• <code>-b$vbv=example "declare variable $v external; $v"</code><br/>• <code>-b{URL}ln=value<br/>"declare namespace ns='URL'; declare variable $ns:ln external; $ns:ln"</code>
|- valign="top"
| {{Code|-c&lt;input&gt;}}
| Executes [[Commands]]:
* Several commands in the input can be separated by semicolons ({{Code|;}}).
* If the specified input is a valid URL or file reference or URL, its content this file will be executed instead. Empty lines and lines starting with the number sign {{Codeevaluated as [[Commands#Command_Scripts|#}} will be ignoredCommand Script]].
|
|
|- valign="top"
| {{Code|-i&lt;input&gt;}}
| Opens a an XML file or database or XML document specified by the argument. The opened input may can then be further processed by an a command or XQuery expression.
|
|
| {{Code|-iitems.xml "//item"}}
|- valign="top"
| {{Code|-LI&lt;input&gt;}}| Separates returned query items by newlines (instead Assigns an input string as item of spaces) and appends a newline type {{Code|xs:untypedAtomic}} to the end of a resultquery context.|
|
|
| {{Code|-I "Hello Universe" -q "."}}
|- valign="top"
| {{Code|-o&lt;file&gt;}}
|- valign="top"
| {{Code|-R}}
| Specifies if a query will be executed or parsed only. {{Mark|Introduced with Version 7.8}}
| <code>[[Options#RUNQUERY|RUNQUERY]]</code>
| <code>true</code>
|
| <code>-smethod=text</code>
|- valign="top"
| {{Code|-t}}
| Runs all [[Unit Module|Unit tests]] in the specified file or directory.
|
|
| -t project/tests
|- valign="top"
| {{Code|-u}}
|- valign="top"
| {{Code|-X}}
| Creates Generates the query plan before or after query compilation. {{Code|-x}} needs to be activated to make the plan visible.
| <code>[[Options#COMPPLAN|COMPPLAN]]</code>
| <code>true</code>
|}
=BaseX Server= 
;Launch the server
<pre>
$ basexserver -h
BaseX [Server]
Usage: basexserver [-cdeinpSzcdinpSz] [stop] stop Stop running server -c<cmdsinput> Execute initial database commandsfrom file or string -d Activate debugging mode -e<port> Set event port -i Enter interactive mode -n<name> Set host the server is bound to -p<port> Set server port -S Start as service -z Suppress logging
</pre>
|- valign="top"
| {{Code|stop}}
| Stops an existing a local database server instance and quits.
|
|
|- valign="top"
| {{Code|-c&lt;cmd&gt;}}
| Launches database Executes [[Commands]]:* Several commands before in the server itself is started. Several commands input can be separated by semicolons ({{Code|;}}).* If the specified input is a valid URL or file reference, this file will be evaluated as [[Commands#Command_Scripts|Command Script]].
|
|
| <code>[[Options#DEBUG|DEBUG]]</code>
| <code>false</code>
|
|- valign="top"
| {{Code|-e&lt;num&gt;}}
| Specifies the port on which the server will send events to clients.
| <code>[[Options#EVENTPORT|EVENTPORT]]</code>
| {{Code|1985}}
| {{Code|-e9998}}
|- valign="top"
| {{Code|-i}}
| Starts the interactive console mode, which can be used to enter database commands. This mode is similar to the default standalone and client mode.
|
|
|
|- valign="top"
|- valign="top"
| {{Code|-S}}
| Starts the server as service (i.e., in the background). Use [[YAJSW]], or start BaseX as an ordinary background process, to get more options.
|
|
Multiple {{Code|-c}} and {{Code|-i}} flags can be specified. All other options will be set before any other operation takes place. The specified inputs, query files, queries and commands will be subsequently evaluated after that in the given order. The standard input can be parsed by specifying a single dash ({{Code|-}}) as argument.
=BaseX Client=
;Launch the console mode communicating with the server
-c<input> Execute commands from file or string
-d Activate debugging mode
-i<input> Open initial XML file or database -L Append newlines I<input> Assign input string to query resultscontext
-n<name> Set server (host) name
-o<output> Write output to file
| {{Code|[input]}}
|Evaluates the specified input:
* The input string may point to an existing file. If the file suffix is {{Code|.bxs}}, the file content contents will be evaluated as [[Commands#Basics|Command Script]]; otherwise, it will be evaluated as XQuery expression.
* Otherwise, the input string itself is evaluated as XQuery expression.
|
| <code>[[Options#BINDINGS|BINDINGS]]</code>
|
|• <code>-b$v=example "declare variable $v external; $v"</code><br/>• <code>-b{URL}ln=value<br/>"declare namespace ns='URL'; declare variable $ns:ln external; $ns:ln"</code>
|- valign="top"
| {{Code|-c&lt;input&gt;}}
|- valign="top"
| {{Code|-i&lt;input&gt;}}
| Opens a an XML file or database or XML document specified by the argument. The opened input may can then be further processed by an a command or XQuery expression.
|
|
| {{Code|-iitems.xml "//item"}}
|- valign="top"
| {{Code|-LI&lt;input&gt;}}| Separates returned query items by newlines (instead Assigns an input string as item of spaces) and appends a newline type {{Code|xs:untypedAtomic}} to the end of a resultquery context.
|
|
| {{Code|-I "Hello Universe" -q "."}}
|- valign="top"
| {{Code|-n&lt;name&gt;}}
|- valign="top"
| {{Code|-R}}
| Specifies if a query will be executed or parsed only. {{Mark|Introduced with Version 7.8}}
| <code>[[Options#RUNQUERY|RUNQUERY]]</code>
| <code>true</code>
|- valign="top"
| {{Code|-X}}
| Creates Generates the query plan before or after query compilation. {{Code|-x}} needs to be activated to make the plan visible.
| <code>[[Options#COMPPLAN|COMPPLAN]]</code>
| <code>after</code>
|}
=BaseX HTTP Server=
;Launch the HTTP server:
$ basexhttp -h
BaseX [HTTP]
Usage: basexhttp [-dehlnpPRUWzdhlnpPRUWz] [stop] stop Stop running server -c<input> Execute commands from file or string -d Activate debugging mode -eh<port> Set event port -h<port> Set port of HTTP server -l Start in local mode -n<name> Set host name of database server -p<port> Set port of database server -P<pass> Specify user password -s<port> Specify port to stop HTTP server -S Start as service -U<name> Specify user name -z Suppress logging
</pre>
|- valign="top"
| {{Code|stop}}
| Stops a running local HTTP serverand quits. By default, the The database server will be stopped as well, unless {{Code|-l}} has been is specified.
| <code>pom.xml</code>
|
|
|- valign="top"
| {{Code|-c&lt;cmd&gt;}}
| Executes [[Commands]]:
* Several commands in the input can be separated by semicolons ({{Code|;}}).
* If the specified input is a valid URL or file reference, this file will be evaluated as [[Commands#Command_Scripts|Command Script]].
|
|
| {{Code|-c"open database"}}
|- valign="top"
| {{Code|-d}}
|
|
|- valign="top"
| {{Code|-e&lt;num&gt;}}
| Specifies the port on which the server will send events to clients.
| <code>[[Options#EVENTPORT|EVENTPORT]]</code>
| {{Code|1985}}
| {{Code|-e9998}}
|- valign="top"
| {{Code|-h&lt;num&gt;}}
| {{Code|1984}}
| {{Code|-p9998}}
|- valign="top"
| {{Code|-P&lt;pass&gt;}}
| Specifies a user password, which will be used by the HTTP services to open a new session. If this flag is omitted, and if {{Code|-U}} was specified, the password will be requested on command line. ''Warning'': when the password is specified with this flag, it may get visible to others.
| <code>[[Options#PASSWORD|PASSWORD]]</code>
|
| {{Code|-Uadmin -Padmin}}
|- valign="top"
| {{Code|-s&lt;num&gt;}}
| Specifies the port that will be used to stop the HTTP server.
| <code>[[Options#STOPPORT|STOPPORT]]</code> or<br/><code>pom.xml</code>
| <code>89838985</code>
|
|- valign="top"
| {{Code|-S}}
| Starts the server as service (i.e., in the background). Use [[YAJSW]], or start BaseX as an ordinary background process, to get more options.
|
|
|}
=BaseX GUI=
;Launch the GUI:
<pre>
=Changelog=
 
;Version 9.0
 
* Added: BaseXHTTP, command-line option {{Code|-c}}.
* Updated: BaseXHTTP, command-line option {{Code|-c}}, additionally accepts valid URLs and file references.
 
;Version 8.2
 
* Removed: Event ports, {{Code|-e}}.
 
;Version 8.1
 
* Added: Bind input strings to the query context with {{Code|-I}}.
 
;Version 8.0
 
* Removed: Command-line option <code>-L</code> (results will now be automatically separated by newlines).
 
;Version 7.9
 
* Added: Runs tests in file or directory with {{Code|-t}}.
* Removed: interactive server mode.
;Version 7.8
* Added: {{Code|-R}} specifies Specify if a query will be executed or parsed onlywith {{Code|-R}}.
;Version 7.7
* Added: {{Code|-n}} binds a Bind host to the [[#BaseX Server|BaseX Server]]with {{Code|-n}}.
;Version 7.5
; Version 7.3:
* Updated: all options are now evaluated in the given order.* Updated: Create main-memory representations for specified sources with {{Code|-i}} creates main-memory representations for specified sources.* Updated: Options {{Code|-C}}/{{Code|-c}} and {{Code|-q}}/{{Code|[input]}} merged.* Updated: Option {{Code|-L}} also separates serialized items with newlines (instead of spaces).
; Version 7.2:
; Version 7.1.1:
* Added: Options {{Code|-C}} and {{Code|-L}} in standalone and client mode.
; Version 7.1:
* Updated: Multiple query files and {{Code|-c}}/{{Code|-i}}/{{Code|-q}} flags can be specified.
 
[[Category:Beginner]]
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu