prisma-driver-adapter-implementation
Implementation guide for Prisma v7 SQL driver adapters, covering SqlDriverAdapter, transaction protocols, error mapping, and verification contracts.
Introduction
This skill serves as the definitive technical reference for developers building custom Prisma ORM v7 driver adapters. It provides low-level architecture guidance for bridging database drivers with PrismaClient through the SqlMigrationAwareDriverAdapterFactory. The instruction set details the implementation of mandatory interfaces including SqlDriverAdapter and Transaction, ensuring correct behavior for query execution, transaction lifecycles, and database-specific metadata handling. Targeted at systems engineers and library authors, it is essential for those extending Prisma to support proprietary or niche SQL databases.
-
Full implementation coverage for SqlDriverAdapter and Transaction interfaces including raw query execution and connection management.
-
Detailed specifications for SqlQuery, SqlResultSet, and ColumnTypeEnum to ensure binary-compatible type mapping between SQL drivers and Prisma client runtime.
-
Guidelines for transaction lifecycle protocol, covering startTransaction, commit, and rollback sequences.
-
Error handling strategy including conversion of native database errors into standardized MappedError and DriverAdapterError types.
-
Verification and testing checklists to validate adapter compliance against the Prisma runtime contract.
-
Use this skill when implementing a new SqlDriverAdapter or modifying internal driver adapter behavior for production-grade applications.
-
Ensure all ArgType definitions are correctly passed into SqlQuery to prevent serialization failures or unexpected runtime type coercion.
-
Follow the provided architecture diagram to correctly structure your adapter factory and maintain proper isolation levels during transaction execution.
-
Pay close attention to the column metadata mapping requirements in SqlResultSet to avoid runtime parsing errors in the Prisma engine.
-
Designed for use when working with @prisma/driver-adapter-utils to ensure all import contracts are strictly satisfied.
Repository Stats
- Stars
- 34
- Forks
- 2
- Open Issues
- 0
- Language
- Not provided
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- May 3, 2026, 06:22 PM