prisma-driver-adapter-implementation

Implements Prisma ORM 7 SQL driver adapters with transaction, savepoint, and error-mapping contracts.

1|2|Updated Aug 14, 2026
One-click install
npx skills add https://github.com/byEduarda/TrabalhoFinal-EJCM2026.2 --skill prisma-driver-adapter-implementation-byeduarda
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-driver-adapter-implementation
Source: https://github.com/byEduarda/TrabalhoFinal-EJCM2026.2/tree/main/back/src/.windsurf/skills/prisma-driver-adapter-implementation
Command: npx skills add https://github.com/byEduarda/TrabalhoFinal-EJCM2026.2 --skill prisma-driver-adapter-implementation-byeduarda

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Building a Prisma SQL driver adapter is error-prone: type-compatible code can still corrupt values, leak connections, or break transactions. This Skill provides the exact contract, priority rules, and verification checklist needed to implement adapters that behave correctly under Prisma ORM 7. ## Core Features & Use Cases - Adapter Contract Guidance: Covers SqlDriverAdapterFactory, SqlDriverAdapter, Transaction, and migration-aware factory interfaces with correct lifecycle semantics. - Transaction & Savepoint Protocol: Enforces one dedicated connection per transaction, commit/rollback as cleanup hooks, and connection-local savepoint handling. - Error & Result Mapping: Preserves original database error codes for useful P2039 fallbacks and maps column types, arguments, and result metadata without silent corruption. - Use Case: When adding a new database driver to Prisma or debugging P2039 errors, transaction leaks, or shadow-database failures, follow this guide to implement and verify the adapter against the exact @prisma/driver-adapter-utils version. ## Quick Start Ask the AI to implement a Prisma SQL driver adapter for your database following the transaction, savepoint, and error-mapping rules in this guide.

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 SQL driver adapter?▼

Implement SqlDriverAdapterFactory with connect(), then SqlDriverAdapter with queryRaw, executeRaw, executeScript, startTransaction, and dispose. Match the exact @prisma/driver-adapter-utils version installed by the target Prisma release and follow the transaction lifecycle rules.

How do Prisma driver adapter transactions work?▼

startTransaction acquires one dedicated connection, begins the transaction, and applies the isolation level. Prisma issues SQL COMMIT/ROLLBACK via executeRaw, so the transaction's commit() and rollback() methods only release the connection exactly once.

Does the Prisma driver adapter support nested transactions and savepoints?▼

Yes, through optional createSavepoint, rollbackToSavepoint, and releaseSavepoint methods on the Transaction object. Savepoint state lives on the transaction's connection, never as adapter-global depth, and identifiers must be validated or quoted.

Why does Prisma throw P2039 with my driver adapter?▼

P2039 surfaces when an unmapped database error reaches Prisma. Preserve originalCode and originalMessage in your DriverAdapterError mapping so the fallback contains useful details instead of a fabricated generic error.

How should a driver adapter handle shadow databases for migrations?▼

Implement SqlMigrationAwareDriverAdapterFactory only if connectToShadowDb() can create an isolated shadow database with a unique quoted name, connect to it, and drop it during disposal or failure cleanup. Never point it at the primary database.