Back to Skills

prisma-driver-adapter-implementation

Required reference for Prisma v7 driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter/Transaction interfaces. Contains critical contract details not inferable from code examples — including the transaction lifecycle protocol, error mapping requirements, and verification checklist. Existing implementations do not replace this skill.

36stars2forksUpdated 5/16/2026

Security Assessment

Safe(90/100)

Detected risks:

Sensitive File Access([SKILL.md] .env)
Security Score90/100

About prisma-driver-adapter-implementation

The `prisma-driver-adapter-implementation` skill is a critical reference for developers working with Prisma ORM v7. It provides comprehensive guidance for implementing or modifying database driver adapters, ensuring correct interaction with Prisma's core systems. This skill addresses the challenge of maintaining consistent and reliable database operations, particularly in complex scenarios where transaction management, error handling, and adapter-specific behaviors must align with Prisma's strict contract requirements. By following the protocols and interface definitions detailed here, developers can implement adapters that are compatible with Prisma's internal architecture and fully support the expected transaction lifecycles and error mappings.

Key features of this skill include detailed architectural diagrams showing the relationships between PrismaClient, the adapter factory, SqlDriverAdapter, and Transaction objects. It specifies required interfaces such as `SqlDriverAdapter`, `SqlMigrationAwareDriverAdapterFactory`, `SqlQuery`, `SqlResultSet`, and `Transaction`, alongside supporting types like `ColumnType`, `ArgType`, and `TransactionOptions`. These definitions ensure that raw SQL execution, query result handling, and transaction lifecycles are implemented consistently. The skill also outlines critical contract details not inferable from examples alone, including error mapping requirements and a verification checklist to validate adapter behavior.

This skill is primarily targeted at software engineers and database developers integrating new database engines with Prisma or extending existing adapters. It is especially useful for teams that need to maintain high reliability and correctness when executing parameterized SQL, managing transactions, or implementing custom database behaviors. Use cases include creating new adapters for unsupported databases, customizing transaction handling for specific database engines, and auditing or improving existing adapter implementations to conform to Prisma v7 standards.

FAQ

How do I start implementing a new driver adapter with this skill?

Begin by reviewing the architecture overview and required interfaces, then implement the `SqlDriverAdapter` and `SqlMigrationAwareDriverAdapterFactory` according to the interface definitions and transaction lifecycle protocols provided.

Which Prisma versions are compatible with this skill?

This skill is designed specifically for Prisma ORM version 7 and may not be fully compatible with earlier or future versions without adjustments.

What are the key requirements for transactions in this adapter?

Transactions must implement lifecycle hooks including `commit()` and `rollback()`, while Prisma handles SQL execution via `executeRaw`. Adhering to the error mapping and verification checklist is required for correct behavior.

Can existing adapter implementations replace this skill?

No. Existing implementations do not replace the reference provided by this skill because it contains critical contract details that are not fully captured in code examples.

What interfaces must be imported to use this skill effectively?

Developers should import types and enums from `@prisma/driver-adapter-utils`, including `SqlDriverAdapter`, `SqlQuery`, `Transaction`, `ColumnTypeEnum`, and `DriverAdapterError`.

Install prisma-driver-adapter-implementation

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

prisma/skills