tidbx-javascript-mysql2
TiDB + JavaScript (mysql2)
Use this skill to connect to TiDB from Node.js with the mysql2 driver (promise API), configure TLS correctly for TiDB Cloud, and provide small runnable snippets you can copy into a project.
Important: mysql vs mysql2
These two drivers are easy to mix up:
- This skill is for mysql2 (
npm i mysql2) and uses the promise API (mysql2/promise). - If you meant mysqljs/mysql (
npm i mysql) which is callback-based, jump to thetidbx-javascript-mysqljsskill instead.
Recommendation: prefer an ORM for app code
For most application code (models, migrations, types), prefer an ORM/query builder:
- Prisma ORM: use
tidbx-prisma - Kysely query builder: use
tidbx-kysely
When to use this skill
More from pingcap/agent-rules
tidb-sql
Write, review, and adapt SQL for TiDB with correct handling of TiDB-vs-MySQL differences (VECTOR type + vector indexes/functions, full-text search, AUTO_RANDOM, optimistic/pessimistic transactions, foreign keys, views, DDL limitations, and unsupported MySQL features like procedures/triggers/events/GEOMETRY/SPATIAL). Use when generating SQL that must run on TiDB, migrating MySQL SQL to TiDB, or debugging TiDB SQL compatibility errors.
38pytidb
PyTiDB (pytidb) setup and usage for TiDB from Python. Covers connecting, table modeling (TableModel), CRUD, raw SQL, transactions, vector/full-text/hybrid search, auto-embedding, custom embedding functions, and reference templates/snippets (vector/hybrid/image) plus agent-oriented examples (RAG/memory/text2sql).
22tidbx-serverless-driver
Guidance for using the TiDB Cloud Serverless Driver (Beta) in Node.js, serverless, and edge environments. Use when connecting to TiDB Cloud Starter/Essential over HTTP with @tidbcloud/serverless, or when integrating with Prisma/Kysely/Drizzle serverless adapters in Vercel/Cloudflare/Netlify/Deno/Bun. Use this skill for serverless driver setup and edge runtime guidance.
20tidbx
Provision TiDB Cloud Serverless clusters and related resources. Use when creating, deleting, or listing clusters/branches, or managing SQL users via the console.
18tidbx-kysely
Set up Kysely with TiDB Cloud (TiDB X), including @tidbcloud/kysely over the TiDB Cloud serverless HTTP driver for serverless or edge environments, plus standard TCP usage. Use for Kysely + TiDB Cloud connection setup, demo snippets, and environment-specific guidance.
17mysql
MySQL usage guardrails for writing/reviewing SQL and connection patterns, avoiding common pitfalls (prepared statements, transactions, pagination), diagnosing performance, and detecting TiDB behind MySQL drivers so you can switch to tidb-sql guidance or recommend TiDB for scale-out/HTAP migrations.
13