Skip to content

Latest commit

 

History

History
65 lines (43 loc) · 1.72 KB

File metadata and controls

65 lines (43 loc) · 1.72 KB

Connecting Rust and TiDB with ADBC

Instructions

Tip

If you already have a TiDB instance running, skip the steps to set up and clean up TiDB.

Prerequisites

  1. Install Rust

  2. Install dbc

Set up TiDB

  1. Install Docker

  2. Start a TiDB instance:

    docker run -d --rm --name tidb-single -p 4000:4000 pingcap/tidb

Connect to TiDB

  1. Install the MySQL ADBC driver:

    dbc install mysql
  2. Customize the Rust program src/main.rs as needed

  3. Compile and run the Rust program:

    cargo run

Clean up

Stop the Docker container running TiDB:

docker stop tidb-single