prisma-driver-adapter-implementation

Implements Prisma ORM v7 driver adapters for custom database drivers.

Updated May 23, 2026
One-click install
npx skills add https://github.com/kveperedo/website --skill prisma-driver-adapter-implementation-kveperedo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-driver-adapter-implementation
Source: https://github.com/kveperedo/website/tree/main/.agents/skills/prisma-driver-adapter-implementation
Command: npx skills add https://github.com/kveperedo/website --skill prisma-driver-adapter-implementation-kveperedo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @prisma/driver-adapter-utils.

What problem does it solve? Implementing a Prisma v7 driver adapter requires contract details that are not inferable from existing code examples, such as the transaction lifecycle protocol, error mapping rules, and column type conversions. This Skill provides the complete specification so an adapter can be built correctly the first time. ## Core Features & Use Cases - Full Interface Reference: Documents SqlDriverAdapter, Transaction, SqlQueryable, and SqlMigrationAwareDriverAdapterFactory with TypeScript definitions and implementation steps. - Transaction Lifecycle Protocol: Explains that commit() and rollback() are lifecycle hooks only, with BEGIN/SAVEPOINT depth handling for nested transactions. - Conversion & Error Mapping: Covers argument mapping, row mapping, column type inference, and MappedError conversion for PostgreSQL, SQLite, and MySQL. - Use Case: You are building a Prisma adapter for a new PostgreSQL-compatible database driver. Follow the step-by-step classes, apply the conversion helpers, and verify against the included checklist and testing strategy. ## Quick Start Ask the AI to implement a Prisma v7 driver adapter for your database driver using this guide, including the factory, adapter, and transaction classes.

Frequently Asked Questions about prisma-driver-adapter-implementation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a Prisma v7 driver adapter for a custom database?▼

Implement four layers: a SqlQueryable base with queryRaw and executeRaw, a Transaction class with commit and rollback hooks, a SqlDriverAdapter adding executeScript and startTransaction, and a SqlMigrationAwareDriverAdapterFactory exposing connect and connectToShadowDb.

How do Prisma driver adapter transactions work?▼

The adapter issues BEGIN at depth one and SAVEPOINT sp_N for nested transactions. commit() and rollback() are lifecycle hooks only and must not issue SQL, because Prisma sends COMMIT and ROLLBACK through executeRaw on the transaction object.

Which databases does the Prisma driver adapter interface support?▼

The SqlMigrationAwareDriverAdapterFactory provider field supports postgres, mysql, sqlite, and sqlserver. Each database has specific notes, such as SQLite allowing only SERIALIZABLE isolation and PostgreSQL needing a reserved connection for transactions.

How should database errors be mapped in a Prisma adapter?▼

Catch driver errors and rethrow them as DriverAdapterError containing a MappedError. Map database-specific codes, such as PostgreSQL 23505 to UniqueConstraintViolation, or use the postgres, sqlite, or GenericJs kinds for unmapped errors.

Why does my Prisma adapter return wrong types for bigint or date columns?▼

Row mapping must convert bigint values to strings, Date objects to ISO 8601 strings, and JSON objects to stringified values. Column types must also be reported via ColumnTypeEnum so Prisma interprets result values correctly.