Interactive mode

Connecting to the server database

To create databases, user and groups, connect to the server database.

When no database name is given in the connection parameters, the admin tool will attempt to connect to the server database. A user with root access must be specified.

Connecting as root without password:

> dboo -u=root
dboo root@dboo::server>

Connecting as root with password:

> ./server_distribution/bin/dboo -u=root -p
Logging in as root to dboo::server on localhost:8822.
password: *****
dboo root@dboo::server>

User databases can not be accessed from the root login.

Connecting to a user database

To access a user database, login as a user with a group that has access to the database.

Connecting as Me without password (where the password is empty):

> dboo MyDatabase -u=Me
dboo Me@MyDatabase>

Connecting as Me with password (where the user has a password):

> dboo MyDatabase -u=Me -p
Logging in as Me to MyDatabase on localhost:8822.
password: *****
dboo Me@MyDatabase>

The password can be entered on the command line:

> dboo MyDatabase -u=Me -p=MyPassword
Logging in as Me to MyDatabase on localhost:8822.
password: *****
dboo Me@MyDatabase>

It is also possible to connect by first starting the dboo prompt and then issue the connect command:

> dboo
dboo> connect MyDatabase --user=Me -p
Logging in as Me to MyDatabase on localhost:8822.
password: *****
dboo Me@MyDatabase>

Connection parameters

> dboo  <database>  [--user=<userid>] [--password[=<password>]] [--host=<host>] [--port=<port>]

If just the ‘–password’ option without the actual password, the user can enter the password at a prompt.

Arguments

Argument

Explanation

database

database name for a user database connection or none if connecting to the server database for managing the server.

Options

Option

Explanation

–user, -u

user id

–password, -p

password

–host, -h

host name/ip address

–port, -P

port number

Command completion

The tab key can be used to show potential commands matching what has already been entered. Keep pressing the tab for paging through different set of assistence. When there is only one potential completion, pressing the tab will complete the entered text.

When using command completion with query statements, the options include class names, field names or functions/operators.

> dboo
dboo>
# If pressing con and then tab, the following appears:
dboo> connect
<database>  options:    --user      --password  --host      --port
dboo> connect MyDatabase --user=Me -p
Logging in as Me to MyDatabase on localhost:8822.
password: *****
dboo Me@MyDatabase>

Auto completion works great for queries. Here is from the example in the Overview:

> dboo example -u=me -p=123
dboo me@example> sel                        1) Type sel and tab.
dboo me@example> select                     2) The word is completed to the only possibility.  Press tab again.
select  select
dboo me@example> select<                    3) Again completed to next step. Press tab again.
<
dboo me@example> select<p                   4) Again completed as far as it can go. Now you have to enter r or u.
product   purchase
dboo me@example> select<pr                  5) Enter r and tab
product   purchase
dboo me@example> select<product             6) And so on... just keep pressing tab to get choices.
product

Input & output operators

Use the in < and > operators to redirect input and output from/to files. In principle all commands’ outputs can be redirected with the > operator. Only the restore command takes any data input, so that is the only where the < operator would be useful.

The following will output the result of the query and any referenced objects to the file mypurchases.json in the current directory.

> dboo example -u=me -p=123
dboo me@example> select<purchase>() --fetch_referenced_objects > ./mypurchases.json

Queries with long output

If a query returns more objects than what can be displayed easily, a prompts is given with a choice of continuing, stopping, outputting all objects without interrupt or the possibility to enter the number of objects to be output.

dboo me@example> select<purchase>() --max_objects=2
{"dboo::objectid" : "040088308e300015", "dboo::class" : "purchase", "_product" : "5c0088308cf40014", "_quantity" : 2}
{"dboo::objectid" : "310088308dd00015", "dboo::class" : "purchase", "_product" : "680088308cc80014", "_quantity" : 1}
2 of 14 selected objects (14.3%). Continue (c), stop (q or interrupt), all objects (a) or type number of objects:

Ctrl-C

Ctrl-C cancels the current input. Pressing Ctrl-C twice on an empty command line will exit the dboo tool:

dboo me@example>                          1) Press Ctrl-C
(To exit, press ^C again or type exit)
dboo me@example> select<purchase>()       2) Press Ctrl-C when something has been entered, clears
dboo me@example>                             the line.

Exit the DBOO manager

Either Ctrl-C twice or exit or quit.

dboo me@example> exit
>