prisma-driver-adapter-implementation

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

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/quanngynx/GDGO-2026.Servexa-Warranty-AI --skill prisma-driver-adapter-implementation-quanngynx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-driver-adapter-implementation
Source: https://github.com/quanngynx/GDGO-2026.Servexa-Warranty-AI/tree/main/servexa-warranty-ai/.agents/skills/prisma-driver-adapter-implementation
Command: npx skills add https://github.com/quanngynx/GDGO-2026.Servexa-Warranty-AI --skill prisma-driver-adapter-implementation-quanngynx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of implementing a Prisma v7 SQL driver adapter where lifecycle semantics, type mappings, and error translation must match Prisma’s expectations exactly.

Core Features & Use Cases

  • Adapter contract coverage: Defines the required Prisma v7 interfaces and how adapter methods should behave end-to-end (querying, executing, transaction lifecycle).
  • Transaction lifecycle safety: Clarifies that commit() and rollback() are lifecycle hooks and must not directly issue SQL, while Prisma sends SQL via executeRaw.
  • Practical implementation guidance: Provides concrete TypeScript-facing interface structures and an implementation checklist for argument mapping, row mapping, isolation levels, and error mapping across providers.

Quick Start

Use the prisma-driver-adapter-implementation skill to implement or modify a Prisma v7 driver adapter by following the adapter/factory/transaction contracts, mapping rules, isolation validation, and error mapping checklist for your target database.

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 SQL driver adapter for PostgreSQL or MySQL?

To implement a Prisma v7 SQL driver adapter, you must build SqlDriverAdapter and SqlMigrationAwareDriverAdapterFactory implementations that adhere to Prisma's query, execute, and transaction lifecycle contracts for your target database. You map arguments and rows to typed values.

What is the correct transaction lifecycle for Prisma driver adapters?

The correct transaction lifecycle for Prisma driver adapters treats commit() and rollback() as lifecycle hooks only, meaning they must not directly issue SQL. Prisma sends the necessary transaction control SQL via the executeRaw method instead.

How does Prisma driver adapter error handling and type mapping work?

Prisma driver adapter error handling requires wrapping database errors in DriverAdapterError with appropriate MappedError kinds, while type mapping converts database arguments to db-types and query rows back to typed values according to Prisma's strict contracts.

Can I use a Prisma driver adapter with SQL Server or SQLite?

Yes, you can use a Prisma driver adapter with SQL Server or SQLite. The skill provides functional requirements and an implementation checklist for argument mapping, isolation-level validation, and error mapping across MySQL, PostgreSQL, SQLite, and SQL Server.

Why does my Prisma driver adapter transaction commit fail without issuing SQL?

A Prisma driver adapter transaction commit fails if you issue SQL directly inside the commit() hook. Commit and rollback are lifecycle hooks only; Prisma handles transaction SQL via executeRaw, so direct SQL calls violate the adapter contract.

Do I need a migration aware factory for Prisma driver adapters?

Yes, you need a SqlMigrationAwareDriverAdapterFactory for Prisma driver adapters when adding database drivers or touching adapter interfaces. It ensures the adapter correctly handles migration contexts alongside standard query and transaction execution.