Client - Query

After the client starts it shows a welcome title and some system info. The client is the way to interact with the database engine, after the connection every command it's sent to the server.

Run the client

Open the terminal, go to the installation folder and if it's not running, run the server executable (actorbased). Once the server is started, run the client (actorbase).

Connection

The first thing to do is connecting to the server. To connect to a server run the following command:

> connect <address>:<port> <username> <password>

  • address: the IP address of a server node that opens a TCP socket.
  • port: the TCP socket's port.
  • username: the username used to log in.
  • password: the user's password used to log in.

If the connection is established and the log in is complete the client shows a success message. Otherwise it shows an error message.

Database queries

Create a database

To create a new database run the following command:

> createdb <database_name>

  • database_name: the name to of the new database.

If the database is created the client shows a success message. If a database with that name already exists it shows an error message.

Delete a database

To delete an existing database run the following command:

> deletedb <database_name>

  • database_name: the name to of the database to delete.

If the database is deleted the client shows a success message. If a database with that name doesn't exist it shows an error message.

List databases

To list all the databases you have at least read permissions on, run the following command:

> listdb

Select a database

Before perform any map-level operation a database must be selected. To select a database run the following command:

> selectdb <database_name>

  • database_name: the name to of the database to select.

If the database is selected the client shows a success message. If a database with that name doesn't exist or you have insufficient permissions, it shows an error message.

Map queries

Create a map

To create a new map run the following command:

> createmap <map_name>

  • map_name: the name to of the new map.

If the map is created the client shows a success message. If a map with that name already exists it shows an error message.

Delete a map

To delete an existing map run the following command:

> deletemap <map_name>

  • map_name: the name to of the map to delete.

If the map is deleted the client shows a success message. If a map with that name doesn't exist it shows an error message.

List maps

To list all the maps in the selected database run the following command:

> listmap

Select a map

Before perform any row-level operation a map must be selected. To select a map run the following command:

> selectmap <map_name>

  • map_name: the name to of the map to select.

If the map is selected the client shows a success message. If a map with that name doesn't exist or you have insufficient permissions, it shows an error message.

Row queries

Insert a row

To insert a new row run the following command:

> insert '<key>' <value>

  • key: the key of the row.
  • value: the value of the row.

If the row is inserted the client shows a success message. If a row with that key already exists it shows an error message.

Update a row

To update the value of a row run the following command:

> update '<key>' <value>

  • key: the key of the row.
  • value: the value of the row.

If the row is updated the client shows a success message. If a row with that key doesn't exists it shows an error message.

Remove a row

To remove an existing row run the following command:

> remove '<key>'

  • key: the key of the row.

If the entry is deleted the client shows a success message. If an entry with that key doesn't exist it shows an error message.

Find a row

To get the value of a key run the following command:

> find 'key'

  • key: the key of the row.

If a row with that key exist the client shows the value, otherwise it shows an error message.

List keys

To get the list of all the keys in the selected map run the following command:

> keys

results matching ""

    No results matching ""