Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

typedb/typedb-driver-rust

Repository files navigation

THIS REPOSITORY HAS BEEN ARCHIVED. Please visit: @vaticle/typedb-driver/rust


TypeDB Client for Rust

Factory Discord Discussion Forum Stack Overflow Stack Overflow

Project Status

This is a work in progress and is not yet suitable for production usage.

It can connect to TypeDB, run read and write queries, and return answers. Concept API methods are not available yet.

Client Architecture

To learn about the mechanism that a TypeDB Client uses to set up communication with databases running on the TypeDB Server, refer to TypeDB > Client API > Overview.

The TypeDB Client for Rust provides a fully async API that supports the tokio multi-threaded runtime.

Quickstart

  1. Import typedb-client through Cargo:
typedb-client = "0.1.2"
  1. Make sure the TypeDB Server is running.
  2. See tests/integration for examples of usage.

Build from Source

Note: You don't need to compile TypeDB Client from source if you just want to use it in your code. See the "Quickstart" section above.

  1. Make sure you have Bazel installed on your machine.

  2. Build the library:

    a) to build the native/raw rlib:

    bazel build //:typedb_client
    

    The rlib will be produced at: bazel-bin/libtypedb_client-{hash}.rlib.

    b) to build the crate for a Cargo project:

    bazel build //:assemble_crate
    

    The Cargo crate will be produced at:

    bazel-bin/assemble_crate.crate
    

    You can then unzip this crate to retrieve Cargo.toml. Please note: this process has not yet been thoroughly tested. The generated Cargo.toml may not be fully correct. See the Cargo.toml of the typedb-client crate for reference.