OverviewHistoryStatsSecurity
npx skills add ...
Documentation
SKILL.md
npx skills add prisma/cursor-plugin --skill prisma-database-setup-cockroachdb
CockroachDB Setup. Reference when using this Prisma feature.
npx skills add prisma/cursor-plugin --skill prisma-database-setup-cockroachdb
Configure Prisma with CockroachDB.
In prisma/schema.prisma:
In prisma.config.ts:
In .env:
Note: CockroachDB uses the PostgreSQL wire protocol, so the URL often looks like postgresql, but the provider MUST be cockroachdb in the schema to handle specific CRDB features correctly.
Prisma ORM 7 uses the query compiler by default, so you must use a driver adapter. CockroachDB is PostgreSQL-compatible, so use the PostgreSQL adapter.
Install adapter and driver:
Instantiate Prisma Client with the adapter:
CockroachDB uses BigInt or UUID for IDs efficiently.
Or using string UUIDs:
Always use provider = "cockroachdb" to ensure correct type mapping during db pull.