prisma-driver-adapter-implementation

Implements Prisma ORM v7 driver adapters for custom database drivers.

7|2|Updated Jul 24, 2026
One-click install
npx skills add https://github.com/ysfcl/GeoMorphosis --skill prisma-driver-adapter-implementation-ysfcl
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-driver-adapter-implementation
Source: https://github.com/ysfcl/GeoMorphosis/tree/main/.windsurf/skills/prisma-driver-adapter-implementation
Command: npx skills add https://github.com/ysfcl/GeoMorphosis --skill prisma-driver-adapter-implementation-ysfcl

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Implementing a Prisma v7 driver adapter requires contract details that cannot be inferred from existing code examples, such as the transaction lifecycle protocol, error mapping rules, and type conversion requirements. This Skill provides the complete specification so an adapter works correctly with PrismaClient on the first attempt. ## Core Features & Use Cases - Full Interface Reference: Defines SqlDriverAdapter, Transaction, SqlQueryable, and SqlMigrationAwareDriverAdapterFactory with TypeScript signatures and ColumnTypeEnum values. - Transaction Lifecycle Protocol: Explains that commit() and rollback() are lifecycle hooks only, with BEGIN/SAVEPOINT depth handling for nested transactions. - Type Conversion & Error Mapping: Provides argument mapping, row mapping, column type inference, and driver error to MappedError conversion for PostgreSQL, SQLite, and MySQL. - Use Case: A developer building a Prisma adapter for a new database driver follows the step-by-step classes, conversion helpers, and the verification checklist, then validates with unit and E2E tests against a real PrismaClient. ## Quick Start Ask the AI to implement a Prisma v7 driver adapter for your database driver using this skill's interface contracts and checklist.

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 layers: a SqlQueryable base class with queryRaw and executeRaw, a Transaction class with commit and rollback hooks, a SqlDriverAdapter adding executeScript and startTransaction, and a SqlMigrationAwareDriverAdapterFactory exposing connect and connectToShadowDb.

How do Prisma adapter transactions handle commit and rollback?▼

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

Does the Prisma adapter interface support nested transactions?▼

Yes, nested transactions use savepoints. Track transaction depth in startTransaction: issue BEGIN at depth one and SAVEPOINT sp_N for deeper levels, validating the isolation level against what the target database supports.

How should database driver errors be mapped for Prisma?▼

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 can interpret constraint and schema errors correctly.

What type conversions does a Prisma adapter need to handle?▼

Input mapping converts strings to int, bigint, float, and base64 to bytes. Output mapping converts bigint to string, Date to ISO 8601 strings, and JSON objects to stringified form, with column types inferred when the driver lacks metadata.