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.
If you are developing locally, you need to clone the repository to your local machine and please install the following tools:
- MySQL Command-Line Client
- Node.js >= 16.x
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.
You can use TiDB Cloud to create a free serverless TiDB cluster, which is convenient for you to develop and test applications.
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.
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 |
- 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
If you encounter problems related to TiDB during development, you can get help in the following ways:
- TiDB Forum
- Stack Overflow (Please add the
tidb
tag to the question)
Regarding the possible problems with the contents of this repository or the sample code, you can get help in the following ways:
TBD