[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79QXB6S20TGV7TSW4SCMZVJ":3,"skill-same:01M79QXB6S20TGV7TSW4SCMZVJ":48},{"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":14,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M79QXB6S20TGV7TSW4SCMZVJ","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.","seifsheikhelarab\u002FVault","seifsheikhelarab","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F46378138?v=4","01M79QRSRVFFWS8MBA5DEE2XJV","Seif Sheikhelarab","01M79QRSSZMY6Y0ZKEVT2C3D7Y",0,"MIT","https:\u002F\u002Fgithub.com\u002Fseifsheikhelarab\u002FVault\u002Fblob\u002Fmaster\u002F.agents\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","master","6b6d7a499865a6b7843b469683e95e70f0fe22ff",".agents\u002Fskills\u002Fprisma-driver-adapter-implementation","https:\u002F\u002Fgithub.com\u002Fseifsheikhelarab\u002FVault","https:\u002F\u002Fgithub.com\u002Fseifsheikhelarab","https:\u002F\u002Fseif-sheikhelarab.pages.dev\u002F","2026-08-29 03:01:56",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add seifsheikhelarab\u002FVault --skill prisma-driver-adapter-implementation",{"tool":40,"command":41},"bunx","bunx skills add seifsheikhelarab\u002FVault --skill prisma-driver-adapter-implementation",{"tool":43,"command":44},"pnpm","pnpm dlx skills add seifsheikhelarab\u002FVault --skill prisma-driver-adapter-implementation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fseifsheikhelarab\u002FVault\u002Fblob\u002Fmaster\u002F.agents\u002Fskills\u002Fprisma-driver-adapter-implementation\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M79QXZ39VJT983QX0YRGT4MN","prisma-upgrade-v7","Complete migration guide from Prisma ORM v6 to v7 covering all breaking changes. Use when upgrading Prisma versions, encountering v7 errors, or migrating existing projects. Triggers on \"upgrade to prisma 7\", \"prisma 7 migration\", \"prisma-client generator\", \"driver adapter required\".","https:\u002F\u002Fgithub.com\u002Fseifsheikhelarab\u002FVault\u002Fblob\u002Fmaster\u002F.agents\u002Fskills\u002Fprisma-upgrade-v7\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M79QXT4HP1C7F8P3WG0E85SN","prisma-postgres","Prisma Postgres setup and operations guidance across Console, create-db CLI, Management API, and Management API SDK. Use when creating Prisma Postgres databases, working in Prisma Console, provisioning with create-db\u002Fcreate-pg\u002Fcreate-postgres, or integrating programmatic provisioning with service tokens or OAuth.","https:\u002F\u002Fgithub.com\u002Fseifsheikhelarab\u002FVault\u002Fblob\u002Fmaster\u002F.agents\u002Fskills\u002Fprisma-postgres\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"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},"01M79QXM5YGEGVDVB53DDWWQPS","prisma-postgres-setup","Set up a new Prisma Postgres database and connect it to a local project using the Management API. Use when asked to \"set up a database\", \"create a Prisma Postgres project\", \"get a connection string\", \"connect my app to Prisma Postgres\", or \"provision a database\".","https:\u002F\u002Fgithub.com\u002Fseifsheikhelarab\u002FVault\u002Fblob\u002Fmaster\u002F.agents\u002Fskills\u002Fprisma-postgres-setup\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},"01M79QXFHBRK7TZJQYXNQ2TXB7","prisma-mongodb-upgrade","Decision and migration guide for Prisma ORM MongoDB projects on v6, which have no upgrade path to v7. Use when a MongoDB project asks about upgrading Prisma, when \"upgrade to prisma 7\" comes up in a project with provider = \"mongodb\", or when evaluating a move to Prisma Next. Triggers on \"upgrade prisma mongodb\", \"prisma 7 mongodb\", \"mongodb prisma migration\", \"prisma next mongodb\".","https:\u002F\u002Fgithub.com\u002Fseifsheikhelarab\u002FVault\u002Fblob\u002Fmaster\u002F.agents\u002Fskills\u002Fprisma-mongodb-upgrade\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},"01M79QX7782ZZT5VD8NY346NZY","prisma-database-setup","Guides for configuring Prisma with different database providers (PostgreSQL, MySQL, SQLite, MongoDB, etc.). Use when setting up a new project, changing databases, or troubleshooting connection issues. Triggers on \"configure postgres\", \"connect to mysql\", \"setup mongodb\", \"sqlite setup\".","https:\u002F\u002Fgithub.com\u002Fseifsheikhelarab\u002FVault\u002Fblob\u002Fmaster\u002F.agents\u002Fskills\u002Fprisma-database-setup\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},"01M79QX1J4V31EZ3PEBBHY9JAY","prisma-compute","Prisma Compute deployment and hosting guide. Use whenever the user mentions Prisma Compute, `prisma.compute.ts`, `defineComputeConfig`, deploying or hosting a Prisma app, `@prisma\u002Fcli app deploy`, `compute:deploy`, `create-prisma --deploy`, `PRISMA_SERVICE_TOKEN`, Compute auth\u002Fworkspaces, apps\u002Fdeployments\u002Fbuild logs\u002Fdomains, localhost vs `0.0.0.0`, deploy port binding, or framework deploy readiness for Hono, Elysia, Next.js, TanStack Start, Astro, Nuxt, Svelte, Nest, Turborepo, or custom\u002Fprebuilt artifacts.","https:\u002F\u002Fgithub.com\u002Fseifsheikhelarab\u002FVault\u002Fblob\u002Fmaster\u002F.agents\u002Fskills\u002Fprisma-compute\u002FSKILL.md",[],[]]