prisma-driver-adapter-implementation

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

Updated Aug 18, 2026
One-click install
npx skills add https://github.com/manab-debnath/trello --skill prisma-driver-adapter-implementation-manab-debnath
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-driver-adapter-implementation
Source: https://github.com/manab-debnath/trello/tree/main/packages/db/.agents/skills/prisma-driver-adapter-implementation
Command: npx skills add https://github.com/manab-debnath/trello --skill prisma-driver-adapter-implementation-manab-debnath

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Building a Prisma SQL driver adapter requires satisfying a strict protocol where 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 - Contract Implementation: Guides implementation of SqlDriverAdapterFactory, SqlDriverAdapter, Transaction, and migration-aware shadow database factories. - Transaction & Savepoint Protocol: Enforces one dedicated connection per transaction, lifecycle-only commit/rollback 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, use this Skill to implement queryRaw, executeRaw, executeScript, and startTransaction correctly, then validate against the included verification checklist. ## Quick Start Ask the AI to implement a Prisma SQL driver adapter for your database driver following the transaction, savepoint, and error mapping rules in this Skill.

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 new database?▼

Implement SqlDriverAdapterFactory with a connect method returning a SqlDriverAdapter that provides queryRaw, executeRaw, executeScript, startTransaction, and dispose. Typecheck against the exact @prisma/driver-adapter-utils version installed by the target Prisma release.

How should transactions work in a Prisma driver adapter?▼

startTransaction must acquire one dedicated connection, begin the transaction, apply the isolation level, and return a Transaction bound to that connection. The commit and rollback methods are lifecycle cleanup hooks that release the connection once, not SQL COMMIT or ROLLBACK issuers.

Does Prisma support savepoints in driver adapters?▼

Yes, Transaction optionally supports createSavepoint, rollbackToSavepoint, and releaseSavepoint methods. Implement them only where the provider supports savepoints, validate identifiers, and keep nested state on the transaction connection rather than adapter-global depth.

Why does Prisma throw P2039 with my driver adapter?▼

P2039 surfaces when an unmapped driver error reaches Prisma. Preserve originalCode and originalMessage in your DriverAdapterError conversion so the fallback remains useful, and rethrow genuinely unexpected non-driver errors instead of fabricating GenericJs ids.

What is a shadow database in Prisma driver adapters?▼

A shadow database is an isolated database created by SqlMigrationAwareDriverAdapterFactory.connectToShadowDb for safe migration validation. It must use cryptographically unique quoted names, never point at the primary database, and be dropped during disposal or failure cleanup.