Managing Databases in the RAI Console

A short guide to managing RelationalAI databases in the RAI Console.

RKGMS databases contain Rel code and data. Rel code includes everything you use to build Rel applications that reason about your data, including definitions, reasoning, integrity constraints, and logic models.

In the RAI Console, RKGMS databases are associated with your RAI account. When you log into the Console, it displays all the databases previously created in your account. You can create, overwrite, and clone databases through the Console.

You can use a database with any available engine. Engines are virtual machines of various sizes that process database transactions.

In the Console, you access RelationalAI Notebooks by opening the database that contains your notebook. The database stores all data and definitions associated with the notebook, including the notebook itself.

Using an Existing Database

To use an existing database:

  1. Make sure an engine has been previously created, and choose an engine from the Engine pull-down menu at the top of the Console. (If no engine has been previously created, you can create one by clicking Create Engine in the Engine pull-down menu.)
  2. Click the Database icon on the left-hand side of the Console. A list of previously created databases displays.
  3. Click the database that you want to use.
  4. Begin working with the database.

Your current database appears in the breadcrumb bar at the top of the Console.

Creating a New Database

You do not need to have an engine running in order to create or delete databases.

To create a new database:

  1. Click the Database icon on the left-hand side of the Console.
  2. Click Create on the right-hand side of the Console.
  3. In the page that opens, enter a name for the database. Unless you want to overwrite an existing database, make sure that this name has not already been used.
  4. Click Create.

Cloning an Existing Database

You can also clone an existing database, which branches all of a database’s data and notebooks into a new database.

To clone an existing database:

  1. Click the Database icon on the left-hand side of the Console.
  2. Click Create on the right-hand side of the Console.
  3. In the page that opens, enter a name for the database, and select the name of the database to be cloned from the Clone Database pull-down menu.
  4. Click Create.

Once you clone a database, the new database functions separately from the original database: any subsequent changes to either database will not affect the other.

Deleting a Database

You do not need to have an engine running in order to create or delete databases.

To delete a database:

  1. Click the Database icon on the left-hand side of the Console.
  2. On the right-hand side of the database you wish to delete, click Delete.
  3. In the confirmation message that appears, click Delete.

Before deleting a database, we recommend:

  1. Checking with other team members to be sure the database can be safely deleted.
  2. Exporting any notebooks from the database that you want to have available later, saving them as local .json files. For details on exporting notebooks, see Exporting and Importing Notebooks in the RAI Notebooks guide.
  3. Exporting any EDB data from the database that you want to preserve, using Export CSV or Export JSON.

Overwriting a Database

You can choose to overwrite an existing database by entering the same name as an existing database and checking the Overwrite option.

Before overwriting a database, we recommend:

  1. Checking with other team members to be sure the database can be safely overwritten.
  2. Exporting any notebooks from the database that you want to have available later, saving them as local .json files. For details on exporting notebooks, see Exporting and Importing Notebooks in the RAI Notebooks guide.
  3. Exporting any EDB data from the database that you want to preserve, using Export CSV or Export JSON.

Working with Notebooks in a Database

All notebooks in the same database load the Rel code that has been installed in that database. This means that if two notebooks share a database, definitions in one will be visible to the other.

When you open a database, a list of installed Rel source files appears to the right of the Notebook list. Sources are code blocks that are persisted in the database.

For more information on working with RAI Notebooks, see the RAI Notebooks guide.