Crash course
The TypeDB crash course will give you a concise overview of the main aspects of working with TypeDB and TypeQL. For a more in-depth introduction, check out TypeDB Academy.
Introduction
The TypeDB crash course is divided into two sections: the environment setup, followed by a choice of pathways. Follow the instructions on this page to quickly set up the environment you’ll need for the crash course. At the end of this page, choose the pathway that most closely matches your previous database experience:
-
New database users: Pathway for those completely new to databases.
-
Relational database users: Pathway for those used to working with relational databases.
-
Graph database users: Pathway for those used to working with graph databases.
Log in to TypeDB Cloud and deploy a new cluster on the Clusters page.
For self-hosted TypeDB installation and setup, see the Self-hosted deployment page.
Connect to TypeDB
In this guide, we will use TypeDB Studio, the standalone GUI-based client for TypeDB. Ensure Studio is installed, then launch the application.
-
Cloud
-
Core
-
In the TypeDB Cloud dashboard, find the cluster you want to connect, and click Connect. Copy the displayed connection URI, replacing the password placeholder with your actual database password.
-
In Studio, click Connect to TypeDB. Paste the copied URI into the Connection URI field and click Connect.
Click Connect to TypeDB. Your connection URI is typedb-core://<host>:<port>
(e.g: typedb-core://localhost:1729
).
Create a project
TypeDB Studio stores queries you create as TypeQL files in a local project directory. To select a project directory, click either Open Project in the Project panel, or the Open Project Directory button in the top toolbar.
Create a new database
To create a new database:
-
Click the Manage Databases button in the top toolbar.
-
Enter a name for a new database and click Create.
-
Select the new database from the Select Database dropdown () in the top toolbar.
Running queries
To run a query:
-
Make sure you are using the correct session type and transaction type. You can change these using the session type toggle () and transaction type toggle () in the top toolbar. The course material will tell you which session and transaction type to use for each query, but you can also refer to the following table.
Session type Transaction type Query types schema
write
Define
data
write
Insert, Delete, Update
data
read
Fetch, Get
-
Open a New Tab in the Text Editor and paste in the query.
-
Click the Run Query button.
-
If the transaction is a
write
transaction: when the query has completed, click Commit Transaction. The course material will tell you when this is necessary.