Loading...
Loading...
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 skill4agent add pingcap/agent-rules tidbx-kyselymysql://DATABASE_URLmysql2MysqlDialect@tidbcloud/kyselyreferences/kysely-usage.mdmysql2import { Kysely, MysqlDialect } from 'kysely'
import { createPool } from 'mysql2'
const pool = createPool({ uri: process.env.DATABASE_URL })
const db = new Kysely({ dialect: new MysqlDialect({ pool }) })references/serverless-kysely-tutorial.mdimport { Kysely } from 'kysely'
import { TiDBCloudServerlessDialect } from '@tidbcloud/kysely'
const db = new Kysely({
dialect: new TiDBCloudServerlessDialect({ url: process.env.DATABASE_URL }),
})