TiDB Examples for Node.js Developers (👷Work in progress)

This repository is a set of TiDB sample code for Node.js developers, which is written in TypeScript and JavaScript.

Due to TiDB's MySQL compatibility, most of the examples are also applicable and valuable to the developers who using MySQL and MariaDB databases.

Getting started

Development environment

If you are developing locally, you need to clone the repository to your local machine and please install the following tools:

Alternatively, you can use the cloud-native development environment GitHub Codespaces or GitPod to open the sample code repository, where the above tools are already installed in advance.

Open in GitHub Codespaces

Open in Gitpod

Create a TiDB cluster

You can use TiDB Cloud to create a free serverless TiDB cluster, which is convenient for you to develop and test applications.

Checkout the sample code

In this code repository, the sample code will be organized and divided into directories according to the type of ORM or Driver.

There is a README.md file in each directory, which will introduce how to run the sample code.

Examples

Driver / ORM

For Driver, we recommend using mysql2 for development.

Name Category Examples
mysqljs/mysql Driver ➡️ Examples (WIP)
mysql2 (Recommended) Driver ➡️ Examples (WIP)
knex/knex Query Builder TODO
TypeORM ORM TODO
Prisma ORM TODO
Sequelize ORM TODO

Advanced Topics

  • Integration with Vercel Serverless Functions (TODO)
  • Developing with the TiDB Cloud Data API in a Node.js application (TODO)
  • Use TiDB Cloud API to manage clusters (TODO)
  • Using Template literals to simplify

Support

If you encounter problems related to TiDB during development, you can get help in the following ways:

Regarding the possible problems with the contents of this repository or the sample code, you can get help in the following ways:

Contributing

TBD

License

Apache 2.0 License