[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BXH2PXRFPHWPF5Z73PD80Z":3,"skill-same:01M7BXH2PXRFPHWPF5Z73PD80Z":50},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":33,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M7BXH2PXRFPHWPF5Z73PD80Z","prisma-driver-adapter-implementation",null,"Required reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter, Transaction, savepoint, result mapping, or DriverAdapterError behavior. Covers current transaction lifecycle, optional savepoint hooks, original database-error preservation, and verification.","CognitionAI\u002Fdevin-marketplace","CognitionAI","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F163493330?v=4","01M7BVSRD98NC4FG8T3EZS6V5M","Cognition","01M7BVSRDX111C2XPWJ0E6MY26",29,"MIT","https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fprisma\u002Fskills\u002Fprisma-driver-adapter-implementation\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: prisma-driver-adapter-implementation\ndescription: Required reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter, Transaction, savepoint, result mapping, or DriverAdapterError behavior. Covers current transaction lifecycle, optional savepoint hooks, original database-error preservation, and verification.\nlicense: MIT\nmetadata:\n  author: prisma\n  version: \"7.9.1\"\n---\n\n# Prisma SQL Driver Adapter Implementation\n\nUse this guide with the exact `@prisma\u002Fdriver-adapter-utils` version installed by the target Prisma release. Driver adapters are a protocol boundary: type-compatible code can still corrupt values, leak connections, or break transactions.\n\n## When to Apply\n\n- Implementing `SqlDriverAdapterFactory`, `SqlMigrationAwareDriverAdapterFactory`, `SqlDriverAdapter`, or `Transaction`\n- Adding nested-transaction\u002Fsavepoint support\n- Mapping driver values, column metadata, bind arguments, or database errors\n- Debugging `P2039`, transaction leaks, shadow-database failures, or adapter-specific query behavior\n\n## Contract snapshot\n\n```typescript\ninterface SqlDriverAdapterFactory extends AdapterInfo {\n  connect(): Promise\u003CSqlDriverAdapter>\n}\n\ninterface SqlMigrationAwareDriverAdapterFactory extends SqlDriverAdapterFactory {\n  connectToShadowDb(): Promise\u003CSqlDriverAdapter>\n}\n\ninterface SqlDriverAdapter extends AdapterInfo {\n  queryRaw(query: SqlQuery): Promise\u003CSqlResultSet>\n  executeRaw(query: SqlQuery): Promise\u003Cnumber>\n  executeScript(script: string): Promise\u003Cvoid>\n  startTransaction(isolationLevel?: IsolationLevel): Promise\u003CTransaction>\n  getConnectionInfo?(): ConnectionInfo\n  dispose(): Promise\u003Cvoid>\n}\n\ninterface Transaction extends AdapterInfo {\n  readonly options: { usePhantomQuery: boolean }\n  queryRaw(query: SqlQuery): Promise\u003CSqlResultSet>\n  executeRaw(query: SqlQuery): Promise\u003Cnumber>\n  commit(): Promise\u003Cvoid>\n  rollback(): Promise\u003Cvoid>\n  createSavepoint?(name: string): Promise\u003Cvoid>\n  rollbackToSavepoint?(name: string): Promise\u003Cvoid>\n  releaseSavepoint?(name: string): Promise\u003Cvoid>\n}\n```\n\n`IsolationLevel` currently includes `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, `SNAPSHOT`, and `SERIALIZABLE`; validate what the concrete database supports.\n\n## Priority rules\n\n| Priority | Rule | Impact |\n|----------|------|--------|\n| CRITICAL | One dedicated connection per transaction | Prevents interleaving and leaks |\n| CRITICAL | `commit`\u002F`rollback` are lifecycle cleanup hooks | Prevents duplicate COMMIT\u002FROLLBACK |\n| CRITICAL | Savepoints live on `Transaction`, not adapter-global depth | Makes nested scopes connection-local |\n| CRITICAL | Preserve original database error code\u002Fmessage | Enables useful `P2039` fallback |\n| HIGH | Map arguments and result metadata exactly | Prevents silent value corruption |\n| HIGH | Shadow databases are isolated and always cleaned up | Makes Migrate safe |\n| HIGH | Dispose only resources the adapter owns | Prevents shutting down caller-owned pools |\n\n## Query implementation\n\n`SqlQuery` contains `sql`, `args`, and parallel `argTypes`. Map each argument using both value and `ArgType`; do not discard type\u002Farity information. Execute in the driver's array\u002Ftuple row mode so column order is stable.\n\n```typescript\nclass ExampleQueryable {\n  readonly provider = 'postgres' as const\n  readonly adapterName = '@acme\u002Fadapter-example'\n\n  constructor(protected readonly connection: DriverConnection) {}\n\n  async queryRaw(query: SqlQuery): Promise\u003CSqlResultSet> {\n    try {\n      const result = await this.connection.query({\n        text: query.sql,\n        values: query.args.map((value, index) =>\n          mapArg(value, query.argTypes[index]),\n        ),\n        rowMode: 'array',\n      })\n\n      return {\n        columnNames: result.fields.map((field) => field.name),\n        columnTypes: result.fields.map(mapColumnType),\n        rows: result.rows,\n      }\n    } catch (error) {\n      throwAdapterError(error)\n    }\n  }\n\n  async executeRaw(query: SqlQuery): Promise\u003Cnumber> {\n    try {\n      const result = await this.connection.execute(\n        query.sql,\n        query.args.map((value, index) => mapArg(value, query.argTypes[index])),\n      )\n      return result.rowsAffected ?? 0\n    } catch (error) {\n      throwAdapterError(error)\n    }\n  }\n}\n```\n\n### Result mapping\n\nReturn `columnNames`, `columnTypes`, and `rows` with identical lengths\u002Forder. Map driver metadata to `ColumnTypeEnum` deliberately:\n\n- signed integer widths to `Int32`\u002F`Int64`; preserve 64-bit values without JS number truncation\n- decimal\u002Fnumeric to `Numeric` using the representation expected by Prisma\n- binary to `Uint8Array`\u002F`Bytes`\n- date-only, time-only, and timestamp to `Date`, `Time`, and `DateTime`\n- UUID, JSON, enum, arrays, and provider-specific unknown values to their explicit types\n- unsupported native types to `DriverAdapterError({ kind: 'UnsupportedNativeDataType', type })`\n\nTest `null`, empty arrays, array element types, big integers, decimals, byte arrays, JSON, dates, and user-defined\u002Funknown native types.\n\n### Script execution\n\n`executeScript` must execute a migration script as the provider expects. Prefer the driver's native multi-statement\u002Fscript facility or a real SQL parser. Naively splitting on `;` breaks functions, triggers, quoted strings, and dialect-specific blocks.\n\n## Transaction protocol\n\n`startTransaction` must acquire one dedicated connection, start the database transaction, apply the requested isolation level, and return a `Transaction` bound to that same connection. If setup fails, release it immediately.\n\n```typescript\nasync startTransaction(level?: IsolationLevel): Promise\u003CTransaction> {\n  const connection = await this.pool.acquire()\n  try {\n    const tx = new ExampleTransaction(connection, () => connection.release())\n    await tx.executeRaw({ sql: 'BEGIN', args: [], argTypes: [] })\n    if (level) {\n      await tx.executeRaw({\n        sql: `SET TRANSACTION ISOLATION LEVEL ${validateLevel(level)}`,\n        args: [],\n        argTypes: [],\n      })\n    }\n    return tx\n  } catch (error) {\n    connection.release(error)\n    throwAdapterError(error)\n  }\n}\n```\n\n### Commit and rollback\n\nPrisma coordinates the SQL `COMMIT`\u002F`ROLLBACK` through `executeRaw`. The transaction object's `commit()` and `rollback()` methods are lifecycle hooks: detach listeners and release the dedicated connection exactly once. They must not issue a second SQL commit\u002Frollback.\n\n```typescript\nclass ExampleTransaction extends ExampleQueryable implements Transaction {\n  readonly options = { usePhantomQuery: false }\n  #closed = false\n\n  constructor(connection: DriverConnection, private readonly release: () => void) {\n    super(connection)\n  }\n\n  async commit() { this.finish() }\n  async rollback() { this.finish() }\n\n  private finish() {\n    if (this.#closed) return\n    this.#closed = true\n    this.release()\n  }\n\n  async createSavepoint(name: string) {\n    await this.control(`SAVEPOINT ${safeSavepoint(name)}`)\n  }\n\n  async rollbackToSavepoint(name: string) {\n    await this.control(`ROLLBACK TO SAVEPOINT ${safeSavepoint(name)}`)\n  }\n\n  async releaseSavepoint(name: string) {\n    await this.control(`RELEASE SAVEPOINT ${safeSavepoint(name)}`)\n  }\n\n  private async control(sql: string) {\n    await this.executeRaw({ sql, args: [], argTypes: [] })\n  }\n}\n```\n\nImplement the optional savepoint methods only where the provider supports them. Validate\u002Fquote savepoint identifiers. For providers whose savepoints are intentionally no-ops, document and test that limitation.\n\nNever keep transaction depth on the shared adapter. Parallel transactions make adapter-global depth incorrect; nested state belongs to the returned transaction connection and Prisma's savepoint calls.\n\n## Error mapping\n\nWrap recognized driver failures in `DriverAdapterError`. Map known conditions to `MappedError` kinds such as constraint violations, authentication\u002Freachability, missing table\u002Fcolumn\u002Fdatabase, timeouts, closed transactions, invalid input, value range, and write conflicts.\n\nFor database errors, preserve `originalCode` and `originalMessage` even when falling back to the provider-specific raw variant:\n\n```typescript\nimport {\n  DriverAdapterError,\n  type Error as DriverAdapterErrorObject,\n  type MappedError,\n} from '@prisma\u002Fdriver-adapter-utils'\n\nfunction convertDriverError(error: DatabaseError): DriverAdapterErrorObject {\n  return {\n    originalCode: String(error.code),\n    originalMessage: error.message,\n    ...mapKnownOrRaw(error),\n  }\n}\n\nfunction mapKnownOrRaw(error: DatabaseError): MappedError {\n  if (error.code === '23505') {\n    return { kind: 'UniqueConstraintViolation', constraint: parsedConstraint(error) }\n  }\n  return {\n    kind: 'postgres',\n    code: String(error.code ?? 'N\u002FA'),\n    severity: error.severity ?? 'N\u002FA',\n    message: error.message,\n    detail: error.detail,\n    column: error.column,\n    hint: error.hint,\n  }\n}\n\nfunction throwAdapterError(error: unknown): never {\n  if (!isDatabaseError(error)) throw error\n  throw new DriverAdapterError(convertDriverError(error))\n}\n```\n\nPrisma uses preserved original details when an unmapped driver error becomes `P2039`. Do not replace every unknown exception with a fabricated `GenericJs` id; rethrow genuinely unexpected non-driver errors so programming bugs remain visible.\n\n## Factory, ownership, and shadow database\n\n- `connect()` returns a fresh usable adapter connection\u002Fpool wrapper.\n- Track whether the factory created the pool. `dispose()` closes owned pools and only detaches listeners from caller-owned pools unless an explicit option transfers ownership.\n- Implement `SqlMigrationAwareDriverAdapterFactory` only when `connectToShadowDb()` can create an isolated shadow database, connect to it, and drop it during disposal\u002Ffailure cleanup.\n- Never point the shadow adapter at the primary database. Quote generated identifiers and use cryptographically unique names.\n- `getConnectionInfo()` should accurately report `schemaName`, `maxBindValues` when applicable, and `supportsRelationJoins`.\n\n## Verification checklist\n\n- [ ] Typecheck against the exact target `@prisma\u002Fdriver-adapter-utils` version\n- [ ] `queryRaw` preserves column order, types, nulls, and precision\n- [ ] `executeRaw` reports affected rows correctly\n- [ ] `executeScript` handles provider-specific multi-statement syntax\n- [ ] Concurrent interactive transactions use distinct dedicated connections\n- [ ] Success commits and releases once; failure rolls back and releases once\n- [ ] Nested transaction tests exercise create\u002Frollback\u002Frelease savepoint hooks\n- [ ] Unsupported isolation levels fail as `InvalidIsolationLevel`\n- [ ] Known constraints map to structured errors\n- [ ] Unmapped database errors retain original code\u002Fmessage and surface useful `P2039`\n- [ ] Dispose ownership is tested for internal and external pools\n- [ ] Shadow database creation, use, failure cleanup, and disposal are isolated\n- [ ] Run Prisma Client integration\u002FE2E tests, not only adapter unit tests\n\n## Source references\n\n- [Driver adapter interfaces](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma\u002Fblob\u002Fv7\u002Fpackages\u002Fdriver-adapter-utils\u002Fsrc\u002Ftypes.ts)\n- [PostgreSQL adapter transaction implementation](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma\u002Fblob\u002Fv7\u002Fpackages\u002Fadapter-pg\u002Fsrc\u002Fpg.ts)\n- [PostgreSQL adapter error mapping](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma\u002Fblob\u002Fv7\u002Fpackages\u002Fadapter-pg\u002Fsrc\u002Ferrors.ts)\n","# Prisma SQL Driver Adapter Implementation\n\nUse this guide with the exact `@prisma\u002Fdriver-adapter-utils` version installed by the target Prisma release. Driver adapters are a protocol boundary: type-compatible code can still corrupt values, leak connections, or break transactions.\n\n## When to Apply\n\n- Implementing `SqlDriverAdapterFactory`, `SqlMigrationAwareDriverAdapterFactory`, `SqlDriverAdapter`, or `Transaction`\n- Adding nested-transaction\u002Fsavepoint support\n- Mapping driver values, column metadata, bind arguments, or database errors\n- Debugging `P2039`, transaction leaks, shadow-database failures, or adapter-specific query behavior\n\n## Contract snapshot\n\n```typescript\ninterface SqlDriverAdapterFactory extends AdapterInfo {\n  connect(): Promise\u003CSqlDriverAdapter>\n}\n\ninterface SqlMigrationAwareDriverAdapterFactory extends SqlDriverAdapterFactory {\n  connectToShadowDb(): Promise\u003CSqlDriverAdapter>\n}\n\ninterface SqlDriverAdapter extends AdapterInfo {\n  queryRaw(query: SqlQuery): Promise\u003CSqlResultSet>\n  executeRaw(query: SqlQuery): Promise\u003Cnumber>\n  executeScript(script: string): Promise\u003Cvoid>\n  startTransaction(isolationLevel?: IsolationLevel): Promise\u003CTransaction>\n  getConnectionInfo?(): ConnectionInfo\n  dispose(): Promise\u003Cvoid>\n}\n\ninterface Transaction extends AdapterInfo {\n  readonly options: { usePhantomQuery: boolean }\n  queryRaw(query: SqlQuery): Promise\u003CSqlResultSet>\n  executeRaw(query: SqlQuery): Promise\u003Cnumber>\n  commit(): Promise\u003Cvoid>\n  rollback(): Promise\u003Cvoid>\n  createSavepoint?(name: string): Promise\u003Cvoid>\n  rollbackToSavepoint?(name: string): Promise\u003Cvoid>\n  releaseSavepoint?(name: string): Promise\u003Cvoid>\n}\n```\n\n`IsolationLevel` currently includes `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, `SNAPSHOT`, and `SERIALIZABLE`; validate what the concrete database supports.\n\n## Priority rules\n\n| Priority | Rule | Impact |\n|----------|------|--------|\n| CRITICAL | One dedicated connection per transaction | Prevents interleaving and leaks |\n| CRITICAL | `commit`\u002F`rollback` are lifecycle cleanup hooks | Prevents duplicate COMMIT\u002FROLLBACK |\n| CRITICAL | Savepoints live on `Transaction`, not adapter-global depth | Makes nested scopes connection-local |\n| CRITICAL | Preserve original database error code\u002Fmessage | Enables useful `P2039` fallback |\n| HIGH | Map arguments and result metadata exactly | Prevents silent value corruption |\n| HIGH | Shadow databases are isolated and always cleaned up | Makes Migrate safe |\n| HIGH | Dispose only resources the adapter owns | Prevents shutting down caller-owned pools |\n\n## Query implementation\n\n`SqlQuery` contains `sql`, `args`, and parallel `argTypes`. Map each argument using both value and `ArgType`; do not discard type\u002Farity information. Execute in the driver's array\u002Ftuple row mode so column order is stable.\n\n```typescript\nclass ExampleQueryable {\n  readonly provider = 'postgres' as const\n  readonly adapterName = '@acme\u002Fadapter-example'\n\n  constructor(protected readonly connection: DriverConnection) {}\n\n  async queryRaw(query: SqlQuery): Promise\u003CSqlResultSet> {\n    try {\n      const result = await this.connection.query({\n        text: query.sql,\n        values: query.args.map((value, index) =>\n          mapArg(value, query.argTypes[index]),\n        ),\n        rowMode: 'array',\n      })\n\n      return {\n        columnNames: result.fields.map((field) => field.name),\n        columnTypes: result.fields.map(mapColumnType),\n        rows: result.rows,\n      }\n    } catch (error) {\n      throwAdapterError(error)\n    }\n  }\n\n  async executeRaw(query: SqlQuery): Promise\u003Cnumber> {\n    try {\n      const result = await this.connection.execute(\n        query.sql,\n        query.args.map((value, index) => mapArg(value, query.argTypes[index])),\n      )\n      return result.rowsAffected ?? 0\n    } catch (error) {\n      throwAdapterError(error)\n    }\n  }\n}\n```\n\n### Result mapping\n\nReturn `columnNames`, `columnTypes`, and `rows` with identical lengths\u002Forder. Map driver metadata to `ColumnTypeEnum` deliberately:\n\n- signed integer widths to `Int32`\u002F`Int64`; preserve 64-bit values without JS number truncation\n- decimal\u002Fnumeric to `Numeric` using the representation expected by Prisma\n- binary to `Uint8Array`\u002F`Bytes`\n- date-only, time-only, and timestamp to `Date`, `Time`, and `DateTime`\n- UUID, JSON, enum, arrays, and provider-specific unknown values to their explicit types\n- unsupported native types to `DriverAdapterError({ kind: 'UnsupportedNativeDataType', type })`\n\nTest `null`, empty arrays, array element types, big integers, decimals, byte arrays, JSON, dates, and user-defined\u002Funknown native types.\n\n### Script execution\n\n`executeScript` must execute a migration script as the provider expects. Prefer the driver's native multi-statement\u002Fscript facility or a real SQL parser. Naively splitting on `;` breaks functions, triggers, quoted strings, and dialect-specific blocks.\n\n## Transaction protocol\n\n`startTransaction` must acquire one dedicated connection, start the database transaction, apply the requested isolation level, and return a `Transaction` bound to that same connection. If setup fails, release it immediately.\n\n```typescript\nasync startTransaction(level?: IsolationLevel): Promise\u003CTransaction> {\n  const connection = await this.pool.acquire()\n  try {\n    const tx = new ExampleTransaction(connection, () => connection.release())\n    await tx.executeRaw({ sql: 'BEGIN', args: [], argTypes: [] })\n    if (level) {\n      await tx.executeRaw({\n        sql: `SET TRANSACTION ISOLATION LEVEL ${validateLevel(level)}`,\n        args: [],\n        argTypes: [],\n      })\n    }\n    return tx\n  } catch (error) {\n    connection.release(error)\n    throwAdapterError(error)\n  }\n}\n```\n\n### Commit and rollback\n\nPrisma coordinates the SQL `COMMIT`\u002F`ROLLBACK` through `executeRaw`. The transaction object's `commit()` and `rollback()` methods are lifecycle hooks: detach listeners and release the dedicated connection exactly once. They must not issue a second SQL commit\u002Frollback.\n\n```typescript\nclass ExampleTransaction extends ExampleQueryable implements Transaction {\n  readonly options = { usePhantomQuery: false }\n  #closed = false\n\n  constructor(connection: DriverConnection, private readonly release: () => void) {\n    super(connection)\n  }\n\n  async commit() { this.finish() }\n  async rollback() { this.finish() }\n\n  private finish() {\n    if (this.#closed) return\n    this.#closed = true\n    this.release()\n  }\n\n  async createSavepoint(name: string) {\n    await this.control(`SAVEPOINT ${safeSavepoint(name)}`)\n  }\n\n  async rollbackToSavepoint(name: string) {\n    await this.control(`ROLLBACK TO SAVEPOINT ${safeSavepoint(name)}`)\n  }\n\n  async releaseSavepoint(name: string) {\n    await this.control(`RELEASE SAVEPOINT ${safeSavepoint(name)}`)\n  }\n\n  private async control(sql: string) {\n    await this.executeRaw({ sql, args: [], argTypes: [] })\n  }\n}\n```\n\nImplement the optional savepoint methods only where the provider supports them. Validate\u002Fquote savepoint identifiers. For providers whose savepoints are intentionally no-ops, document and test that limitation.\n\nNever keep transaction depth on the shared adapter. Parallel transactions make adapter-global depth incorrect; nested state belongs to the returned transaction connection and Prisma's savepoint calls.\n\n## Error mapping\n\nWrap recognized driver failures in `DriverAdapterError`. Map known conditions to `MappedError` kinds such as constraint violations, authentication\u002Freachability, missing table\u002Fcolumn\u002Fdatabase, timeouts, closed transactions, invalid input, value range, and write conflicts.\n\nFor database errors, preserve `originalCode` and `originalMessage` even when falling back to the provider-specific raw variant:\n\n```typescript\nimport {\n  DriverAdapterError,\n  type Error as DriverAdapterErrorObject,\n  type MappedError,\n} from '@prisma\u002Fdriver-adapter-utils'\n\nfunction convertDriverError(error: DatabaseError): DriverAdapterErrorObject {\n  return {\n    originalCode: String(error.code),\n    originalMessage: error.message,\n    ...mapKnownOrRaw(error),\n  }\n}\n\nfunction mapKnownOrRaw(error: DatabaseError): MappedError {\n  if (error.code === '23505') {\n    return { kind: 'UniqueConstraintViolation', constraint: parsedConstraint(error) }\n  }\n  return {\n    kind: 'postgres',\n    code: String(error.code ?? 'N\u002FA'),\n    severity: error.severity ?? 'N\u002FA',\n    message: error.message,\n    detail: error.detail,\n    column: error.column,\n    hint: error.hint,\n  }\n}\n\nfunction throwAdapterError(error: unknown): never {\n  if (!isDatabaseError(error)) throw error\n  throw new DriverAdapterError(convertDriverError(error))\n}\n```\n\nPrisma uses preserved original details when an unmapped driver error becomes `P2039`. Do not replace every unknown exception with a fabricated `GenericJs` id; rethrow genuinely unexpected non-driver errors so programming bugs remain visible.\n\n## Factory, ownership, and shadow database\n\n- `connect()` returns a fresh usable adapter connection\u002Fpool wrapper.\n- Track whether the factory created the pool. `dispose()` closes owned pools and only detaches listeners from caller-owned pools unless an explicit option transfers ownership.\n- Implement `SqlMigrationAwareDriverAdapterFactory` only when `connectToShadowDb()` can create an isolated shadow database, connect to it, and drop it during disposal\u002Ffailure cleanup.\n- Never point the shadow adapter at the primary database. Quote generated identifiers and use cryptographically unique names.\n- `getConnectionInfo()` should accurately report `schemaName`, `maxBindValues` when applicable, and `supportsRelationJoins`.\n\n## Verification checklist\n\n- [ ] Typecheck against the exact target `@prisma\u002Fdriver-adapter-utils` version\n- [ ] `queryRaw` preserves column order, types, nulls, and precision\n- [ ] `executeRaw` reports affected rows correctly\n- [ ] `executeScript` handles provider-specific multi-statement syntax\n- [ ] Concurrent interactive transactions use distinct dedicated connections\n- [ ] Success commits and releases once; failure rolls back and releases once\n- [ ] Nested transaction tests exercise create\u002Frollback\u002Frelease savepoint hooks\n- [ ] Unsupported isolation levels fail as `InvalidIsolationLevel`\n- [ ] Known constraints map to structured errors\n- [ ] Unmapped database errors retain original code\u002Fmessage and surface useful `P2039`\n- [ ] Dispose ownership is tested for internal and external pools\n- [ ] Shadow database creation, use, failure cleanup, and disposal are isolated\n- [ ] Run Prisma Client integration\u002FE2E tests, not only adapter unit tests\n\n## Source references\n\n- [Driver adapter interfaces](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma\u002Fblob\u002Fv7\u002Fpackages\u002Fdriver-adapter-utils\u002Fsrc\u002Ftypes.ts)\n- [PostgreSQL adapter transaction implementation](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma\u002Fblob\u002Fv7\u002Fpackages\u002Fadapter-pg\u002Fsrc\u002Fpg.ts)\n- [PostgreSQL adapter error mapping](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma\u002Fblob\u002Fv7\u002Fpackages\u002Fadapter-pg\u002Fsrc\u002Ferrors.ts)\n",{"name":5,"license":15,"metadata":24,"description":7},{"author":25,"version":26},"prisma","7.9.1","main","9836d94e88404aabb682086405c2aa9cba7657ac","plugins\u002Fprisma\u002Fskills\u002Fprisma-driver-adapter-implementation",156,"https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace","https:\u002F\u002Fgithub.com\u002FCognitionAI","https:\u002F\u002Fcognition.ai\u002F","Makers of Devin, the AI software engineer.","2026-11-13 07:08:23",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add CognitionAI\u002Fdevin-marketplace --skill prisma-driver-adapter-implementation",{"tool":42,"command":43},"bunx","bunx skills add CognitionAI\u002Fdevin-marketplace --skill prisma-driver-adapter-implementation",{"tool":45,"command":46},"pnpm","pnpm dlx skills add CognitionAI\u002Fdevin-marketplace --skill prisma-driver-adapter-implementation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fprisma\u002Fskills\u002Fprisma-driver-adapter-implementation\u002FSKILL.md",true,[],[51,57,64,70,77,84],{"skillNo":52,"name":53,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M7BYC4AJGM98P2G9JH7QS24Z","business-data","https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fwindsor-ai\u002Fskills\u002Fbusiness-data\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7BYBZ0CD4CBCPZHRZ551BNK","workflow","Creates durable, resumable workflows using Vercel's Workflow SDK. Use when building workflows that need to survive restarts, pause for external events, retry on failure, or coordinate multi-step operations over time. Triggers on mentions of \"workflow\", \"durable functions\", \"resumable\", \"workflow sdk\", \"queue\", \"event\", \"push\", \"subscribe\", or step-based orchestration.","https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fvercel\u002Fskills\u002Fworkflow\u002Fupstream\u002FSKILL.md",[],[],{"skillNo":65,"name":59,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7BYB1XSZHKHD8JZTQJ62JN0","Vercel Workflow SDK expert guidance. Use when building durable workflows, long-running tasks, API routes or agents that need pause\u002Fresume, retries, step-based execution, or crash-safe orchestration with Vercel Workflow.","https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fvercel\u002Fskills\u002Fworkflow\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7BYASGMK935J33E21N5WTW0","verification","Full-story verification — infers what the user is building, then verifies the complete flow end-to-end: browser → API → data → response. Triggers on dev server start and 'why isn't this working' signals.","https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fvercel\u002Fskills\u002Fverification\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7BY9WJERKSKEH9HK6E71GW2","vercel-storage","Vercel storage expert guidance — Blob, Global Config (formerly Edge Config), and Marketplace storage (Neon Postgres, Upstash Redis). Use when choosing, configuring, or using data storage with Vercel applications.","https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fvercel\u002Fskills\u002Fvercel-storage\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7BY9N034894YV2J9DCRZHYS","vercel-services","Configure and troubleshoot Vercel Services for multiple frontends and backends in one project. Use when composing a polyglot or multi-service application on one Vercel deployment; defining the `services` key, service-targeted rewrites, or service bindings in `vercel.json`; or running all services with `vercel dev`.","https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fvercel\u002Fskills\u002Fvercel-services\u002FSKILL.md",[],[]]