Managing Databases in the RAI Console
RelationalAI’s RKGS 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.
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.
Using the Databases Page
Here’s how to navigate the Databases page:
-
To access the Databases page, click the Databases icon on the left-hand side of the Console. The Databases page lists all previously created databases associated with your RelationalAI account.
-
To rearrange databases in ascending or descending alphabetical order, click the arrow next to the Name field.
-
To select a database, click its name in the list. This will automatically take you to the Editor page, and you will see the name of your selected database in the Databases pop-up menu in a newly created worksheet.
-
To search or filter databases, type text or values into the Quick Filter field. Quick Filter conducts a search on all columns.
-
To view the state of your database, see the respective information under State.
-
To view the region in which your database was created, see the respective information under Region. All RAI databases are set to the US-East region by default.
-
To view the date and time a database was created, see the respective information under Created On. Note that you can see the full details of when the database was created by holding the pointer over the date. To rearrange databases by the date they were created, click Created On.
-
To clone an existing database:
-
Click the Clone icon next to the database you want to clone.
-
In the window that opens, your clone database is named
<your_database>_clone
by default. You can change the name. The Clone from field displays the name of your selected database by default. To select a different database, click the up-down arrow and choose a database from the list. -
Click Create. The name of your clone database then appears in the list.
⚠You cannot clone from a database until an engine has executed at least one transaction on that database.
See Cloning Databases for more ways to clone databases.
-
-
To create a new database:
- Click + Database in the top right-hand corner.
- In the window that opens, give your database a name.
- Click Create.
Note that you can also create databases from the Databases pop-up menu in the Editor. See Selecting a Database in the Working With Worksheets guide.
-
To access RAI notebooks, click the Notebooks icon.
⚠Notebooks will soon be deprecated. It’s best to use worksheets to run queries in the Console.
-
To delete a database:
- Click X next to the database you want to delete.
- In the Confirmation window that opens, click Delete. The database will disappear from the list.
See Best Practices Before Deleting a Database for more details.
Database States
Databases can be in one of four states:
State | Explanation |
---|---|
CREATING | Database is being created. |
CREATED | Database has been created and can be used. |
CREATION FAILED | An error occured and the database was not created successfully. |
DELETED | Database has been deleted and no longer appears in the list. |
Cloning Databases
In addition to using the Clone icon mentioned above, you can directly create a new clone database from the Databases as well as the Editor pages. 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.
You can also clone a database from the Databases page as follows:
- Click + Database in the top right-hand corner and give your clone database a name.
- In the Clone from field, click the up-down arrow and choose the database you want to clone.
- Click Create. The name of your new clone database appears in the list.
To create a new clone database from the Editor page:
- Click the Databases pop-up menu in the Editor.
- Click Create Database.
- Under Name in the window that opens, give your database a name.
- Under Clone from, click the up-down arrow to choose the existing database you want to clone.
- Click Create. The new clone database appears in your list of databases in the Databases page.
Best Practices Before Deleting a Database
Before deleting a database, it’s best practice to:
- Check with other team members to be sure the database can be safely deleted.
- Export any output results of worksheets in the database that you want to have available later, saving them as local CSV or Excel files. For more details, see Exporting Results in the Working With Worksheets guide.
- Export any models from the database that you want to have available later, saving them as local
.rel
files. For more details, see Exporting Models in the Working With Models guide.
Worksheets, base relations, and models from the deleted database are unrecoverable.