TiDB Serverless is compatible with MySQL, so you can use MySQL connection guide to connect to it.
Drizzle <> TiDB Serverless
This guide assumes familiarity with:
- Database connection basics with Drizzle
- TiDB database - website
- TiDB HTTP Driver - website
- Drizzle MySQL drivers - docs
According to the official website, TiDB Serverless is a fully-managed, autonomous DBaaS with split-second cluster provisioning and consumption-based pricing.
TiDB Serverless provides an HTTP driver for edge environments. It is natively supported by Drizzle ORM via drizzle-orm/tidb-serverless
package.
Step 1 - Install packages
npm
yarn
pnpm
bun
Step 2 - Initialize the driver and make a query
If you need to provide your existing driver: