prisma-driver-adapter-implementation

Implement Prisma ORM v7 SQL driver adapters with transaction lifecycle and error mapping.

1|Updated May 1, 2026
One-click install
npx skills add https://github.com/Joshkovu/ghost-ai --skill prisma-driver-adapter-implementation-joshkovu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-driver-adapter-implementation
Source: https://github.com/Joshkovu/ghost-ai/tree/main/.agents/skills/prisma-driver-adapter-implementation
Command: npx skills add https://github.com/Joshkovu/ghost-ai --skill prisma-driver-adapter-implementation-joshkovu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prisma v7 driver adapters are hard to implement safely because they require exact contract behavior for transactions, error mapping, and SQL/result typing that is not reliably inferable from examples.

Core Features & Use Cases

  • Adapter contract & architecture: Defines the PrismaClient → SqlMigrationAwareDriverAdapterFactory → SqlDriverAdapter → Transaction responsibilities and how Prisma routes SQL calls.
  • Deterministic interface coverage: Specifies the required types and methods (queryRaw, executeRaw, executeScript, startTransaction, dispose, plus Transaction commit/rollback semantics).
  • Correct transaction lifecycle: Ensures commit() and rollback() act as lifecycle hooks only (no SQL), while Prisma sends COMMIT/ROLLBACK through executeRaw.
  • Robust mapping requirements: Covers argument mapping, row mapping, column type inference, isolation level validation, and database-specific error mapping via DriverAdapterError/MappedError.
  • Practical implementation checklist: Provides a verification list to confirm the adapter meets Prisma’s expectations before being considered complete.

Quick Start

Use the prisma-driver-adapter-implementation skill when implementing or modifying a Prisma v7 SqlDriverAdapter or Transaction so you follow the required transaction lifecycle, argument/row/column type mappings, and error mapping checklist for your target provider.

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 driver adapter for a custom database provider?

To implement a Prisma driver adapter, define adapter factories, query execution, and transaction behavior while satisfying the SqlMigrationAwareDriverAdapterFactory and SqlDriverAdapter interfaces. You must ensure correct transaction lifecycle, error mapping, and SQL/parameter typing.

How do Prisma driver adapter transaction commit and rollback hooks work?

Transaction commit() and rollback() act as lifecycle hooks only and do not issue SQL. Prisma sends the actual COMMIT or ROLLBACK statements through the adapter's executeRaw method, ensuring the transaction lifecycle is managed correctly by the ORM.

How do I map database errors to Prisma's DriverAdapterError contract?

To map database errors, translate your specific database provider's errors into Prisma's MappedError contract. This robust mapping requirement ensures the adapter handles database-specific error mapping via DriverAdapterError correctly across query execution and transaction phases.

Does my Prisma SQL driver adapter need argument and column type mapping?

Yes, your Prisma SQL driver adapter requires robust argument mapping, row mapping, and column type inference. The adapter must satisfy required interfaces and correctly map results to Prisma's SqlResultSet contract before being considered complete.

What is the Prisma v7 SqlDriverAdapter implementation checklist?

The implementation checklist verifies that your adapter meets Prisma's expectations by confirming deterministic interface coverage, transaction lifecycle semantics, isolation-level validation, and correct mapping to the SqlResultSet and MappedError contract for your target provider.