Agent skill · software engineering · aiskillstore

prisma-driver-adapter-implementation

Required reference for Prisma v7 driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter/Transaction interfaces. Contains critical contract details not inferable from code examples — including the transaction lifecycle protocol, error mapping requirements, and verification checklist. Existing implementations do not replace this skill.

Why this skill is useful

Adds detailed implementation guidelines and critical contract details for Prisma v7 driver adapters that are not available in public documentation.

What it needs

About 8k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

Prisma 7 Driver Adapter Implementation Guide This skill provides everything needed to implement a Prisma ORM v7 driver adapter for any database. Architecture Overview Required Interfaces Import from @prisma/driver-adapter-utils: Interface Definitions SqlQuery (input to queryRaw/executeRaw) SqlResultSet (output from queryRaw) ColumnTypeEnum values SqlDriverAdapter Transaction SqlMigrationAwareDriverAdapterFactory Implementation Steps Step 1: Create the Queryable base class Step 2: Create the Transaction class Critical: commit() and rollback() are lifecycle hooks only. They must NOT issue SQL. Prisma sends COMMIT/ROLLBACK via executeRaw on the transaction object. Step 3: Create the Adapter class Step 4: Create the Factory class Conversion Helpers Argument Mapping (input) Convert Prisma argument values to driver-native types: Row Mapping (output) Convert driver result values to Prisma-expected types: Column Type Inference When the driver doesn't provide type metadata, infer from JS values: Error Handling Map driver errors to MappedError for Prisma to handle correctly: Database-Specific Notes SQLite Set safeIntegers: true when opening the database to get bigint for large integers Only SERIALIZABLE isolation level is valid executeScript: split on ; and run each statement individually Boolean values: store as 0/1, return as boolean PostgreSQL All standard isolation levels are valid For connection pooling (PgBouncer), use prepare: false Transactions require a dedicated connection (reserve() pattern) executeScript: use multi-statement execution (.simple() in some drivers) int8 columns may return as string (already stringified by driver) numeric columns return as string to preserve precision MySQL/MariaDB Supports READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SERIALIZABLE Use ? placeholders for parameters Handle BIGINT as string for large values Testing Strategy Unit Tests (no PrismaClient) Test the adapter directly with the raw database driver: E2E Tests (with PrismaCl …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/prisma-driver-adapter-implementation

View the source on GitHub

Browse the @skills marketplace