Labsco
prisma logo

prisma-upgrade-v7-driver-adapters

✓ Official8

by prisma · part of prisma/cursor-plugin

Driver Adapters. Reference when using this Prisma feature.

🔥🔥🔥✓ VerifiedFreeQuick setup
🧩 One of 7 skills in the prisma/cursor-plugin package — works on its own, and pairs well with its siblings.

Driver Adapters. Reference when using this Prisma feature.

Inspect the full instructions your agent will receiveExpand

This is the exact playbook injected into your agent when the skill activates — shown here so you can audit it before installing. You don't need to read it to use the skill.

by prisma

Driver Adapters. Reference when using this Prisma feature. npx skills add https://github.com/prisma/cursor-plugin --skill prisma-upgrade-v7-driver-adapters Download ZIPGitHub8

Driver Adapters

Prisma v7 requires driver adapters for all database connections. This replaces the built-in Rust query engine.

Why Driver Adapters?

  • No more binary downloads

  • Smaller bundle size

  • Better serverless/edge compatibility

  • Uses native Node.js database drivers

  • More control over connection pooling

Available Adapters

Database Adapter Package Underlying Driver PostgreSQL @prisma/adapter-pg pg MySQL / MariaDB @prisma/adapter-mariadb mariadb SQLite @prisma/adapter-better-sqlite3 better-sqlite3 Prisma Postgres @prisma/adapter-ppg @prisma/ppg SQL Server @prisma/adapter-mssql mssql Neon @prisma/adapter-neon @neondatabase/serverless PlanetScale @prisma/adapter-planetscale @planetscale/database Turso/libSQL @prisma/adapter-libsql @libsql/client D1 (Cloudflare) @prisma/adapter-d1 Cloudflare D1

Migration from v6

Before (v6)

Copy & paste — that's it
import { PrismaClient } from '@prisma/client'

const prisma = new PrismaClient({
 datasources: {
 db: { url: process.env.DATABASE_URL }
 }
})

After (v7)

Copy & paste — that's it
import { PrismaClient } from '../generated/client'
import { PrismaPg } from '@prisma/adapter-pg'

const adapter = new PrismaPg({
 connectionString: process.env.DATABASE_URL
})

const prisma = new PrismaClient({ adapter })

Singleton Pattern

Copy & paste — that's it
// lib/prisma.ts
import { PrismaClient } from '../generated/client'
import { PrismaPg } from '@prisma/adapter-pg'

const globalForPrisma = globalThis as unknown as {
 prisma: PrismaClient | undefined
}

const adapter = new PrismaPg({
 connectionString: process.env.DATABASE_URL!
})

export const prisma = globalForPrisma.prisma ?? new PrismaClient({ adapter })

if (process.env.NODE_ENV !== 'production') {
 globalForPrisma.prisma = prisma
}