tidbx-nextjs

Installation
SKILL.md

TiDB Next.js Integration

Set up a Next.js app (App Router) that connects to TiDB, with clear guidance on where database code can run (Node runtime) and how to avoid common serverless pitfalls.

What is different about Next.js (vs plain Node scripts)

  • Full-stack framework: UI and server code live in one project.
  • Server/client split: database code must stay server-side (route handlers, server components, server actions).
  • Multiple runtimes: some routes can run on Edge; TCP database clients must run on Node runtime.
  • File-based routing: API endpoints are files like app/api/*/route.ts.

When to use this skill

  • Build a new Next.js app that reads/writes TiDB
  • Add TiDB to an existing Next.js App Router project
  • Deploy to Vercel (or other serverless platforms) and avoid connection/caching/runtime issues
  • Decide between Prisma/Kysely vs direct mysql2

Key decisions (recommended defaults)

Related skills

More from pingcap/agenticstore

Installs
1
GitHub Stars
14
First Seen
Mar 18, 2026