Officially out now: The TypeDB 3.0 Roadmap

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 databases 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.

Run TypeDB

To start TypeDB, select the TypeDB edition below and follow the instructions.

  • Cloud

  • Core

Log in to TypeDB Cloud and create a new deployment on the Deployments page.

For self-hosted TypeDB Cloud installation and setup, see the Self-hosted deployment page.

Ensure TypeDB Core is installed.

To start a locally installed TypeDB Core server:

typedb server

To create a new Docker container with TypeDB Core server:

docker volume create typedb-data
docker create --name typedb -v typedb-data:/opt/typedb-all-linux-x86_64/server/data -p 1729:1729 --platform linux/amd64 vaticle/typedb:latest

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

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, then close the Address Management window.

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

    For newly created deployments, the default username and password are admin and password. After connecting for the first time, you will be required to change the password before queries can be run.

  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.

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.

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 studio projects Open Project Directory button in the top toolbar.

Create a new database

To create a new database:

  1. Click the studio dbs Manage Databases button in the top toolbar.

  2. Enter a name for a new database and click Create.

  3. Select the new database from the Select Database dropdown (database none) in the top toolbar.

Running queries

To run a query:

  1. Make sure you are using the correct session type and transaction type. You can change these using the session type toggle (session schema) and transaction type toggle (transaction write) 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

  2. Open a studio new New Tab in the Text Editor and paste in the query.

  3. Click the studio run Run Query button.

  4. If the transaction is a write transaction: when the query has completed, click studio check Commit Transaction. The course material will tell you when this is necessary.

Choose a pathway

With setup complete, choose the pathway that most closely matches your previous database experience.

Pathway for those completely new to databases.

Pathway for those used to working with relational databases.

Pathway for those used to working with graph databases.