Skip to content
Using the RelationalAI View

Using the RelationalAI View

After connecting to RelationalAI, you need to configure the project’s settings and see what information is available in your VS Code environment.

This section shows you how to use and navigate the RelationalAI View menu items: Admin, Databases, Engines, and Transactions.

relationalai-view-sections

Using the Admin Section

When you click Admin, a pull-down menu appears and displays the following submenu items: Profile, Configuration, and Commands.

admin-submenu-items

These items allow you to switch and edit profiles, set configuration options, and view a list of supported commands, respectively.

Switching and Editing Profiles

Say you have multiple profiles in ~/.rai/config. To switch between them:

  1. Click Profile. This displays the user profiles.
  2. Select the profile you want by clicking it.

Selecting a profile highlights it in orange.

You can also edit your profiles or credentials:

  1. Under Profile, click Edit Profiles. This opens your ~/.rai/config file.
edit-profiles-icon
  1. Edit your profile and credentials as needed.
  2. Press Control+S (PC) or Command+S to save.

Configuring Options

You can select, filter, and set default options when working on your project.

To do so:

  1. Click Configuration. A drop-down menu opens with a list of configuration options.
  2. Select the option you want to configure. This shows you a brief description of the option and a Configure this Option button.
  3. Click Configure this Option. This opens your relationalai-vscode.toml file — creating it if necessary. It also automatically inserts the option and prompts you for values.
  4. Insert the values as applicable.
  5. Press Control+S (PC) or Command+S (Mac) to save.

For example, when you set a default profile, database, and engine, the relationalai-vscode.toml file will look like this:

profile = "my_profile"
database = "my_database"
engine = "my_engine"
🔎

The Extension will remember your selected profile, database, and engine for each project and use them when you reopen a project folder in VS Code.

Accessing Commands

To view a list of all supported Commands, click Commands. You can click on any command to run it.

commands-list
🔎

You can also view commands from the Command Palette by pressing Control+Shift+P (PC) or Command+Shift+P (Mac) and typing RelationalAI.

Using the Databases Section

To be able to work on your project and start querying in Rel, you need to either select an existing database or create a new one.

Selecting or Creating a Database

To use an existing database:

  1. Click the down arrow next to the Databases field. A list of databases associated with your account appears.
  2. Select a database from the list by clicking it.

To create a new database:

  1. Next to Databases, click +.
create-database
  1. Give your database a name and press Enter (PC) or Return (Mac).

Creating or selecting a database highlights the database’s name in orange.

Cloning a Database

To clone an existing database:

  1. Click the clone icon next to the database you want to clone.
clone-icon
  1. In the top bar, give the clone database a name.
  2. Click Enter (PC) or Return (Mac).

The name of your clone database then appears in the list, highlighted in orange. 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

To delete a database:

  1. Click the trash bin icon next to the database you want to delete.
delete-icon
  1. In the confirmation message that opens, click Yes, delete it.

The database will then disappear from the list.

🔎

You can also use the Databases section to manage relations and view relation dependencies. See the Managing Relations guide and Using the Relation Dependency Graph Viewer in Using the Viewers guide, respectively.

Using the Engines Section

All queries require an engine to run. To use a database, you must choose or create an engine.

Selecting or Creating an Engine

To select an engine:

  1. Click the down arrow next to Engines.
  2. Select an engine from the list by clicking it.
select-engine

To create a new engine:

  1. Next to Engines, click the + icon.
  2. In the top bar, give the new engine a name and press Enter (PC) or Return (Mac). You need to enter a name that has not been previously used for an engine.
  3. Select a size for your engine and press Enter (PC) or Return (Mac). Available engine sizes are XS (extra small), S (small), M (medium), L (large), and XL (extra large). For now, start with S. You can increase the size at a later stage should you need to load more data or require more resources for concurrent workloads.

The new engine now appears in the list.

🔎

The engine may take a few minutes to be provisioned. You can use the engine once it is successfully provisioned.

Selecting or creating an engine highlights the engine’s name in orange.

Viewing the Engine Status

To view information about an engine, click > next to the desired engine. You get details on the following fields:

FieldExplanation
nameThe name of the engine.
sizeThe size of the engine.
stateThe state of the engine.
account nameThe RelationalAI account associated with the engine.
regionThe region in which your engine was created. All RelationalAI engines are set to the us-east region by default.
created byThe ID of the client who created the engine.
created onThe date and time the engine was created.
requested onThe date and time the engine was requested.

Deleting an Engine

To delete an engine:

  1. Move your pointer to the engine you want to delete and click the trash bin icon that appears.
  2. In the confirmation message that opens, click Yes, delete it.

The engine will then be deleted from the list.

Using the Transactions Section

The Transactions section lists the last 100 transactions associated with your RelationalAI account. You can view the details of each transaction and cancel a running transaction. Running transactions are highlighted in orange.

Viewing Transaction Details

To view transactions in your database, click Transactions.

To view a transaction’s details, click > next to the desired transaction. You get a list detailing the following:

FieldExplanation
idA unique identifier for the transaction.
stateThe current state of the transaction. See Transaction States in the Console’s Managing Transactions guide for more details.
created onThe date and time the transaction was initiated.
finished onThe date and time the transaction finished running.
durationThe amount of time a transaction took to run.
read onlyWhether or not the transaction was read-only.
databaseThe name of the database on which the transaction ran.
engineThe name of the engine on which the transaction ran.
account nameThe RelationalAI account associated with the transaction.
queryThe contents of the transaction.
languageThe programming language used to write the query.
tagsThe metadata attached to a transaction. This is set to ["vscode-user"] by default.
Open in ConsoleA link to open the transaction in the RelationalAI Console. Clicking it redirects you to the Console login page.
Find Transaction in Local CacheA feature allowing you to open this query’s cached data in your Editor. To enable it, set the cache-output configuration option to true.

Canceling Running Transactions

Running transactions are indicated by an orange transaction icon. You can cancel a transaction while it’s running. To do so, either:

  • In the RAI Output Viewer, click cancel (read) or cancel (write).
cancel-transaction

OR

  • In the RelationalAI View, under the Transactions section, move your pointer to the running transaction you want to to cancel and click the stop icon that appears.
cancel-transaction-2

Filtering Engines, Databases, and Transactions

If you want to limit the results that display in the Databases, Engines, and Transactions sections in the RelationalAI View, you can do that with the database-filter, engine-filter, and transaction-filter settings in your relationalai-vscode.toml file:

database-filter = "^anon.*"
engine-filter = "^anon.*"
[transaction-filter]
    database_name = "^anon.*"

The settings above, for example, show only the databases and engines whose names start with anon, as well as the transactions whose associated database name starts with anon. The values for filters are treated as regular expressions (opens in a new tab).

You can specify other fields in the transaction filter table (opens in a new tab), including engine_name, database_name, id, query, state, and tags. By default, transaction-filter is set to tags = "vscode-user", meaning that you only see the transactions you issued from the RelationalAI VS Code extension.

🔎

To view other filters, use the RelationalAI: Configure command for a list of available options.

Was this doc helpful?