mcpbeat Sign in

Prisma Upgrade V7 Driver Adapters Skill for Cursor

Driver Adapters. Reference when using this Prisma feature.

1k tokens
context cost
the whole folder, loaded on every use
2
files
instructions only
0
copies elsewhere
how many repositories repackaged it
8
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/prisma/cursor-plugin --skill prisma-upgrade-v7-driver-adapters

What comes with it

113 bytes besides the instruction
metadata.json

The instruction itself

26 sections, as written by the author

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 |

Installation

PostgreSQL

npm install @prisma/adapter-pg

MySQL

npm install @prisma/adapter-mariadb mariadb

SQLite

npm install @prisma/adapter-better-sqlite3

Prisma Postgres

npm install @prisma/adapter-ppg @prisma/ppg

SQL Server

npm install @prisma/adapter-mssql mssql

Configuration

PostgreSQL

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 })

MySQL

import { PrismaClient } from '../generated/client'
import { PrismaMariaDb } from '@prisma/adapter-mariadb'

const adapter = new PrismaMariaDb({
  host: 'localhost',
  port: 3306,
  connectionLimit: 5,
  user: process.env.MYSQL_USER,
  password: process.env.MYSQL_PASSWORD,
  database: process.env.MYSQL_DATABASE,
})

const prisma = new PrismaClient({ adapter })

SQLite

import { PrismaClient } from '../generated/client'
import { PrismaBetterSqlite3 } from '@prisma/adapter-better-sqlite3'

const adapter = new PrismaBetterSqlite3({
  url: process.env.DATABASE_URL || 'file:./dev.db'
})

const prisma = new PrismaClient({ adapter })

Neon (Serverless PostgreSQL)

import { PrismaClient } from '../generated/client'
import { PrismaNeon } from '@prisma/adapter-neon'

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

const prisma = new PrismaClient({ adapter })

Prisma Postgres

import { PrismaClient } from '../generated/client'
import { PrismaPostgresAdapter } from '@prisma/adapter-ppg'

const prisma = new PrismaClient({
  adapter: new PrismaPostgresAdapter({
    connectionString: process.env.PRISMA_DIRECT_TCP_URL,
  }),
})

SQL Server

import { PrismaClient } from '../generated/client'
import { PrismaMssql } from '@prisma/adapter-mssql'

const adapter = new PrismaMssql({
  server: 'localhost',
  port: 1433,
  database: 'mydb',
  user: process.env.SQLSERVER_USER,
  password: process.env.SQLSERVER_PASSWORD,
  options: {
    encrypt: true,
    trustServerCertificate: true,
  },
})

const prisma = new PrismaClient({ adapter })

Connection Pool Configuration

Driver adapters use the underlying driver's pool settings, which differ from v6 defaults.

PostgreSQL with custom pool

import { PrismaPg } from '@prisma/adapter-pg'

const adapter = new PrismaPg({
  connectionString: process.env.DATABASE_URL,
  // Pool configuration
  max: 10,                    // Maximum connections
  idleTimeoutMillis: 30000,   // Close idle connections after 30s
  connectionTimeoutMillis: 5000, // Connection timeout (v6 default was 5s)
})

Matching v6 behavior

const adapter = new PrismaPg({
  connectionString: process.env.DATABASE_URL,
  connectionTimeoutMillis: 5000,  // v6 used 5 second timeout
})

SSL Configuration

Accept self-signed certificates

const adapter = new PrismaPg({
  connectionString: process.env.DATABASE_URL,
  ssl: {
    rejectUnauthorized: false  // Accept self-signed certs
  }
})

Proper SSL configuration

const adapter = new PrismaPg({
  connectionString: process.env.DATABASE_URL,
  ssl: {
    ca: fs.readFileSync('/path/to/ca-cert.pem'),
    rejectUnauthorized: true
  }
})

Migration from v6

Before (v6)

import { PrismaClient } from '@prisma/client'

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

After (v7)

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

// 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
}

How to use it

Copy the folder

Take prisma/prisma-upgrade-v7-driver-adapters from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference npm. Without those the skill loads but fails at the first command.