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 example

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 example

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 example

C

Install TypeDB C Driver

  1. Download the C driver package from the TypeDB package repository.

  2. Extract the archive and include the header and library in your project:

    #include "typedb_driver.h"
    
    Credentials* credentials = credentials_new("admin", "password");
    DriverOptions* options = driver_options_new(false, NULL);
    TypeDBDriver* driver = driver_open("127.0.0.1:1729", credentials, options);

C driver example

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.