skills/tidbx-kysely/SKILL.md
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.
npx skillsauth add pingcap/agenticstore tidbx-kyselyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when a user wants to connect Kysely to TiDB Cloud (TiDB X). Default to standard TCP (Node server/runtime). Only use the TiDB Cloud serverless driver over HTTP for serverless or edge runtimes.
mysql:// URL in DATABASE_URL).mysql2 pool + Kysely MysqlDialect.@tidbcloud/kysely dialect over HTTP.references/kysely-usage.md for full examples.Use this for Node servers, long-lived runtimes, or when TCP is available. This is the
primary path unless the user explicitly needs serverless/edge. Uses TCP with a mysql2
pool.
import { Kysely, MysqlDialect } from 'kysely'
import { createPool } from 'mysql2'
const pool = createPool({ uri: process.env.DATABASE_URL })
const db = new Kysely({ dialect: new MysqlDialect({ pool }) })
Use this only when the runtime cannot keep TCP connections (serverless/edge). Requires
the TiDB Cloud serverless driver and Starter/Essential clusters. Use from backend
services only (browser origins may be blocked by CORS). See
references/serverless-kysely-tutorial.md for the full walkthrough.
import { Kysely } from 'kysely'
import { TiDBCloudServerlessDialect } from '@tidbcloud/kysely'
const db = new Kysely({
dialect: new TiDBCloudServerlessDialect({ url: process.env.DATABASE_URL }),
})
devops
Provision TiDB Cloud Serverless clusters and related resources. Use when creating, deleting, or listing clusters/branches, or managing SQL users via the console.
devops
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.
tools
Prisma ORM setup and usage for TiDB from Node.js/TypeScript. Covers configuring prisma/schema.prisma (MySQL provider), DATABASE_URL formatting for TiDB Cloud TLS (sslaccept=strict and optional sslcert), migrations (prisma migrate), Prisma Client generation, CRUD patterns, and safe raw SQL ($queryRaw) plus runnable templates.
development
Build and deploy Next.js (App Router) apps that connect to TiDB. Covers Route Handlers (app/api/*/route.ts), Node vs Edge runtime selection for database access, environment variable handling, and production-safe DB patterns on Vercel/serverless. Prefer Prisma/Kysely integration, with optional mysql2 for minimal examples. Includes guides and TypeScript templates.