prisma-driver-adapter-implementation

Implements Prisma v7 driver adapters for custom database drivers.

Updated Jun 11, 2026
One-click install
npx skills add https://github.com/brillianodhiya/VisionScript --skill prisma-driver-adapter-implementation-brillianodhiya
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-driver-adapter-implementation
Source: https://github.com/brillianodhiya/VisionScript/tree/main/.agents/skills/prisma-driver-adapter-implementation
Command: npx skills add https://github.com/brillianodhiya/VisionScript --skill prisma-driver-adapter-implementation-brillianodhiya

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Implementing a Prisma ORM v7 driver adapter requires contract details that cannot be inferred from existing code examples, such as the transaction lifecycle protocol, error mapping rules, and column type conversions. This Skill provides the complete interface definitions, implementation steps, and verification checklist needed to build a working adapter for any database. ## Core Features & Use Cases - Full Interface Reference: Covers SqlDriverAdapter, Transaction, SqlQueryable, and SqlMigrationAwareDriverAdapterFactory with TypeScript definitions and ColumnTypeEnum values. - Transaction Lifecycle Protocol: Explains the critical rule that commit() and rollback() are lifecycle hooks only, with BEGIN/SAVEPOINT depth tracking for nested transactions. - Conversion and Error Mapping: Provides argument mapping, row mapping, column type inference, and driver error to MappedError conversion for PostgreSQL, SQLite, and MySQL. - Use Case: You are building a Prisma adapter for a new database driver. Follow the four implementation steps, apply the database-specific notes, and validate against the checklist with unit and E2E tests using PrismaClient. ## Quick Start Ask the AI to implement a Prisma v7 driver adapter for your database driver using this guide, including the factory, adapter, and transaction classes.

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

Implement four classes: a SqlQueryable base with queryRaw and executeRaw, a Transaction class with commit and rollback lifecycle hooks, a SqlDriverAdapter with executeScript and startTransaction, and a SqlMigrationAwareDriverAdapterFactory with connect and connectToShadowDb.

How do Prisma adapter transactions handle commit and rollback?▼

The commit() and rollback() methods are lifecycle hooks only and must not issue SQL. Prisma sends COMMIT and ROLLBACK statements via executeRaw on the transaction object, so these methods only release the connection or resources.

Does Prisma v7 support nested transactions in driver adapters?▼

Yes, nested transactions use savepoints. Track transaction depth in the adapter: depth one issues BEGIN with an optional isolation level, while deeper levels issue SAVEPOINT sp_N statements.

How do I map database errors in a Prisma driver adapter?▼

Wrap all driver errors in DriverAdapterError with a MappedError kind. Map database-specific codes, such as PostgreSQL 23505 to UniqueConstraintViolation or SQLite extended codes, so Prisma handles constraint violations correctly.

What type conversions does a Prisma adapter need?▼

Input mapping converts strings to int, bigint, or float and base64 strings to bytes. Output mapping converts bigint to string, Date to ISO 8601 strings, and JSON objects to stringified values, with column types matched to ColumnTypeEnum.