TypeDB Drivers

TypeDB drivers are client libraries that enable applications to communicate with TypeDB servers. They provide a programming language-specific interface for all server operations, from connection management to query execution.

Python

Install TypeDB Python Driver through Pip

  1. Install typedb-driver using pip:

    pip install typedb-driver
  2. In your Python program, import from typedb.driver:

    from typedb.driver import *
    
    driver = TypeDB.driver(address=TypeDB.DEFAULT_ADDRESS, ...)

Python driver tutorial

TypeScript (HTTP)

Install TypeDB HTTP TypeScript Driver from NPM

  1. Install typedb-driver-http using npm:

    npm install typedb-driver-http
  2. In your Node.js or Web application, import from typedb-driver-http:

    import { TypeDBHttpDriver, isApiErrorResponse } from "typedb-driver-http";
    
    const driver = new TypeDBHttpDriver({
        username: "...",
        password: "...",
        addresses: [ "..." ],
    });

TypeScript HTTP driver example

Rust

Install TypeDB Rust Driver through Cargo

  1. Install typedb-driver using cargo:

    cargo add typedb-driver
  2. Use TypeDB Driver in your program:

    use typedb_driver::TypeDBDriver;
    
    let driver = TypeDBDriver::new_core(TypeDBDriver::DEFAULT_ADDRESS).await.unwrap();

Rust driver tutorial

Java

Install TypeDB Java Driver using Maven

  1. Import typedb-driver using Maven:

    <repositories>
        <repository>
            <id>repo.typedb.com</id>
            <url>https://repo.typedb.com/public/public-release/maven/</url>
        </repository>
    </repositories>
    
    <dependencies>
        <dependency>
            <groupId>com.typedb</groupId>
            <artifactId>typedb-driver</artifactId>
            <version>{version}</version>
        </dependency>
    </dependencies>
  2. Use TypeDB Driver in your program:

    import com.typedb.driver.TypeDB;
    import com.typedb.driver.api.Driver;
    import com.typedb.driver.api.Credentials;
    import com.typedb.driver.api.DriverOptions;
    
    try (Driver driver = TypeDB.driver(TypeDB.DEFAULT_ADDRESS, new Credentials("admin", "password"), new DriverOptions(false, null))) {
        ...
    }

Java driver tutorial

Other languages

If TypeDB doesn’t yet have a driver for the language your application is using, get in touch with the team. Or for applications where performance isn’t critical, you can interface directly with TypeDB’s HTTP API.

After installation

Get started using TypeDB Cloud without installing anything.

Install and run TypeDB Community Edition (CE).

Explore the core concepts of TypeDB drivers.

Browse the TypeDB Driver API reference.