Difference between revisions of "Command-Line Client"

From BaseX Documentation
Jump to navigation Jump to search
Line 3: Line 3:
 
   
 
   
 
==Startup==
 
==Startup==
First of all, please launch a '''standalone''' version of BaseX: double click on the '''BaseX''' icon, or run the <code>basex</code> script. [[Startup|Follow this link]] for more information (you may as well have a look at the additional [[Startup Advanced#BaseX|command-line options]]).
+
First of all, please launch a '''standalone''' version of BaseX: double click on the '''BaseX''' icon, or run the <code>basex</code> script. [[Startup|Follow this link]] for more information (you may as well have a look at the additional [[Startup Advanced#BaseX Standalone|command-line options]]).
  
 
==Working with the BaseX Console==  
 
==Working with the BaseX Console==  

Revision as of 23:25, 23 January 2011

BaseX offers a standalone console mode from which all database commands can be executed. The Server Tutorial contains a good introduction on how to run commands in the console mode.

Startup

First of all, please launch a standalone version of BaseX: double click on the BaseX icon, or run the basex script. Follow this link for more information (you may as well have a look at the additional command-line options).

Working with the BaseX Console

After the BaseX Console has been started, the HELP command can be used to to list all database commands. Several commands can be separated by semicolons.

To evaluate commands without entering the console mode, you can use the -c option on the command line:

basex -Vc "CREATE DB input input.xml; XQUERY /"

Database 'input' created in 53.64 ms.
<html>
  <!-- Header -->
  <head id="0">
    <title>XML</title>
  </head>
  <!-- Body -->
  <body id="1" bgcolor="#FFFFFF" text="#000000" link="#0000CC">
    <h1>Databases & XML</h1>
    <div align="right">
      <b>Assignments</b>
      <ul>
        <li>Exercise 1</li>
        <li>Exercise 2</li>
      </ul>
    </div>
  </body>
  <?pi bogus?>
</html>

Query: /

Compiling:

Result: root()

Parsing: 0.19 ms
Compiling: 9.27 ms
Evaluating: 0.33 ms
Printing: 3.08 ms
Total Time: 12.88 ms
Results: 1 Item
Updated: 0 Items
Printed: 375 Bytes
Memory: 5834 KB

Query executed in 13.25 ms.

All available command-line options can be found here.

See also

GUI Tutorial, Server Tutorial, Getting Started