New ACM paper, free-tier cloud, and open-source license

TypeDB Studio

TypeDB Studio hero image


TypeDB Studio is an IDE that facilitates the development process for TypeDB databases.

With Studio developers can efficiently manage databases, execute queries, and explore query results, all within a unified environment. It has a built-in TypeQL support, as well as Type Browser, Type Editor, and query results visualizer.

The GitHub repository with the source code and release notes.

See the TypeDB Studio installation guide.

Setting up

To prepare TypeDB Studio for work, you need to complete the following steps:

  1. Select a project directory to save your queries locally.

  2. Connect to a TypeDB Cloud cluster or a TypeDB Core server.

  3. Select a database to work with.

Select a project directory

TypeDB Studio stores queries you work with as files in a local directory, called project directory. To select a project directory, click on the open folder icon (studio projects) in the top toolbar.

Connect to TypeDB

Select TypeDB edition below, and follow the instructions:

  • Cloud

  • Core

TypeDB Studio connect window
  1. Click Connect to TypeDB on the right side of the top toolbar.

  2. Switch the Server field drop-down to TypeDB Cloud.

  3. Click Manage Cloud Addresses button.

  4. Add address and port for at least one server from your TypeDB Cloud deployment. Close the Address management window.

  5. Fill in the Username and Password fields with valid user credentials.

  6. Turn on the Enable TLS option and leave the CA Certificate field empty.
    For self-hosted deployments, encryption parameters may vary.

  7. Click Connect.

On your first login you will be asked to change the password for the admin account. A TypeDB Cloud deployment will refuse queries until the password is changed from its default value.

TypeDB Studio connect window
  1. Click Connect to TypeDB on the right side of the top toolbar.

  2. Make sure the TypeDB Core option is selected in the Server field.

  3. Enter the address and port of the server to connect to (e.g., localhost:1729).

  4. Click Connect.

Select a database

TypeDB can work with one database at a time. To select a database to work with, use the dropdown menu on the right from the database icon (studio dbs) in the top toolbar.

If there are no databases yet, see how to create a new one.

If the dropdown menu is greyed out and unresponsive, then check your connection to TypeDB.

Querying

To send a query from TypeDB Studio to TypeDB:

  1. Prepare a query in a tab

  2. Run a query from a tab

  3. See the results of your query in all available output formats

For more information on switching session/transaction types and controls over queries and transactions, see the Transaction controls section.

Prepare a query

TypeDB has a Text editor that can edit most text files and has a built-in syntax highlighting for TypeQL. It can also run TypeQL queries from .tql and .typeql files. Each file can have one or more queries.

To create a new file, open a new tab in the Text editor panel. The file will be created and saved with temporary name in a hidden folder ./typedb-studio inside the selected project directory. There is an autosave feature that persists all the changes made in a file to disk. It can be disabled in settings. By manually saving (studio save) a temporary file you can rename and move it from the hidden folder.

Run a query

Commit the Transaction

Select a session type (session data) and a transaction type (transaction write) in the top Toolbar.

To run a query file, open it in a tab of the Text editor panel and click the Run Query button (studio run) from the top Toolbar.

For a write transaction type wait for a query to complete its execution and select one of the transaction control actions: Commit (studio check), Close (studio fail), etc.

If a write transaction committed successfully — a blue pop-up with confirmation is displayed. If any error occurs during a transaction, it is shown as a red pop-up.

For more information on different control elements for query execution, see the Transaction controls section below.

Query results

Under the Text editor panel there is the Results panel. The Results panel is collapsed by default if no query has been run yet.

This panel has two sets of tabs: Run and Output. Run tabs represent separate runs of a query file. You can pin a tab to preserve it. Otherwise, it will be rewritten with the next run.

Output tabs represent different output formats for the results: Log and Graph. Log tab contains textual output, similar to TypeDB Console, as well as input log, and error messages. Graph tab is available for Get queries only. It uses Studio’s Graph Visualizer to build a graphical representation of query results.

Transaction controls

To control query execution, we have the top Toolbar elements located to the right from the database selection drop-down menu.

Transaction controls
Table 1. The top Toolbar controls
# Name Icon / Visual Action description

1

Session type switch

session data

Select a session type to use for queries.

2

Transaction type switch

transaction read

Select a transaction type to use for queries

3

snapshot button

snapshot

Enable snapshot feature that encapsulates a transaction in a snapshot of a database’s data until the transaction is committed or closed. Write transactions are always snapshoted. May be enabled or disabled for read transactions.

4

infer button

infer

Enable inferring data by rules. Only available for read transactions.

5

explain button

explain

Enable explanations mechanics.

6

Transaction status indicator

studio status

Transaction activity indicator.
Green if there is a transaction opened by TypeDB Studio at this moment.
Gray if there is no opened transaction.
Rotating animation — TypeDB Studio processing the query or the results (including additional API calls).

7

Close transaction button

studio fail

Close active transaction without committing the results.

8

Rollback transaction button

studio back

Revert the transaction results without closing it.

9

Commit transaction button

studio check

Commit the changes and close the transaction.

10

Run Query button

studio run

Run query or queries in the active tab of the Text editor panel. It will open a transaction (with the session type and transaction type specified in the Toolbar on the left) and execute the TypeQL code against the selected database.

11

Stop Signal button

studio stop

Stop query execution after the next result.

Inference

Inference results example

To run a query with inference, enable the infer button before executing a query. If the button is unavailable, double-check TypeDB connection, database selection, and transaction type being set to read.

As a result of running a query with inference, you can get additional results via inference. If there are any inferred instances of data returned from a Get query, they will be highlighted with green color in the Graph Visualizer. See an example on the image to the right.

Explanation

Explanation example

To run a query with explanation, turn the explain button on before executing a query. To be able to do that, the infer and snapshot buttons must be enabled.

If the explain button is inactive, double-check that Studio is connected to TypeDB, a database is selected with a drop-down list in the toolbar, and the infer and snapshot buttons are on.

To see an explanation, find an inferred result in Graph Visualizer (should be highlighted in green) on the Graph tab and double-click on the highlighted result. If there is an explanation for the inferred result, it spawns in visualization as new concepts. If there is no additional explanation available for the selected result, or all explanations have already been spawned, a pop-up notification appears.

Connection management

To connect, disconnect, or change connection settings, use the Connect to TypeDB button in the top right corner. While connected to TypeDB, the button changes its label to server’s address.

Databases management

Database Manager with IAM database

Creating and deleting databases can be done via the Manage Database window. To open the Manage Database window, make sure TypeDB Studio is connected to TypeDB server and click on the database button (studio dbs) in the top toolbar.

To create a new database:

  1. Enter the name for the new database

  2. Push Create.

To delete a database:

  1. Select a database to delete from a list of databases and click the trashcan icon on its right.

  2. Confirm deletion by typing in the name of the database to delete and then clicking the Delete button.

Type Browser

Type browser

Type Browser panel gives you a full overview of the type hierarchy for the currently selected database.

In an empty database, there are only three root types shown in the panel.

In a database with a schema, all types displayed in the exact hierarchy they were created (subtypes inside their supertypes).

Double-clicking on any type opens the Type Editor window with information about the selected type.

Export schema

You can export all type definitions of a schema by clicking the Export Schema Types button on the top of the Type Browser panel. Exporting rules is not supported by this button yet.

The button creates a new tab with inserted TypeQL Define query that creates the schema of the database.

Type Editor

Type editor

Type Editor is a powerful instrument that combines easy to use GUI with API calls that can modify schema types directly, without TypeQL queries. With Type Editor, it’s much easier to rename a type or change type hierarchy by changing a supertype of a type. And it works even for types that already have data inserted for them.

Type Editor window gives you a full overview of the selected type: its label, parent, owned attributes, played roles, owners (for attributes), related roles (for relations), subtypes, and whether it’s an abstract type.

Type Editor can rename a type, change its supertype, change whether it’s an abstract type, add or remove owned attributes, related roles, played roles, as well as just delete a type or export its full definition.

For the Type Editor be able to modify a schema, make sure to switch to the schema session and write transaction in the top toolbar.

Rename a type

To rename a type:

  1. Open the Type Editor window by double-clicking on the selected type in the Type Browser.

  2. At the very top, click on the pencil icon immediately right from the type name.

  3. Edit the name in the Label field and press the Rename button to save the changes.

  4. Commit the transaction by the Commit (studio check) button at the top toolbar.

You can also do the same by right-clicking on the type in the Type Browser panel and choosing the Rename Type option.

Renaming a type in any of these two ways updates the relevant type references in the schema and does not lead to loosing existing data. All existing instances of the type will be available under the new label.

Delete a type

To delete a type:

  1. Open the Type Editor window by double-clicking on the selected type in the Type Browser.

  2. At the very bottom, click the Delete button and then the Confirm button.

  3. Commit the transaction by the Commit (studio check) button at the top toolbar.

You can also do the same by right-clicking on the type in the Type browser panel and choosing the Delete option, then clicking the Confirm button.

In some cases, the Delete option and button can be unavailable. That means there are some conditions that prevent you from deleting this type. For example, we can’t delete a type that has a subtype.

Settings

To see TypeDB Studio settings, open the Manage Preferences window by clicking on the button with the gear (⚙) icon in the top right corner of the window.

Version Compatibility

TypeDB Studio
(release notes)

Protocol encoding version

TypeDB Core

TypeDB Cloud

2.28.0

3

2.28.0

2.28.0

2.27.0

3

2.27.0

2.27.0

2.26.6

3

2.26.6

2.26.6

2.25.11

3

2.25.7

2.25.7

2.24.15

2

2.24.17

2.24.17

2.18.0 to 2.21.2

1

2.18.0 to 2.23.0

2.18.0 to 2.23.0

2.14.1 to 2.17.0

N/A

2.14.1 to 2.17.0

2.14.1 to 2.17.0

See older versions
TypeDB Studio Protocol encoding version TypeDB Core TypeDB Cloud

2.11.0

N/A

2.11.1

2.11.1 to 2.11.2

Provide Feedback