{"id":"7e9d65108653fc86","repo":"drizzle-team/drizzle-orm","slug":"method-not-implemented-7e9d65","errorCode":null,"errorMessage":"Method not implemented.","messagePattern":"Method not implemented\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"drizzle-orm/src/prisma/pg/session.ts","lineNumber":34,"sourceCode":"export class PrismaPgPreparedQuery<T> extends PgPreparedQuery<PreparedQueryConfig & { execute: T }> {\n\tstatic override readonly [entityKind]: string = 'PrismaPgPreparedQuery';\n\n\tconstructor(\n\t\tprivate readonly prisma: PrismaClient,\n\t\tquery: Query,\n\t\tprivate readonly logger: Logger,\n\t) {\n\t\tsuper(query, undefined, undefined, undefined);\n\t}\n\n\toverride execute(placeholderValues?: Record<string, unknown>): Promise<T> {\n\t\tconst params = fillPlaceholders(this.query.params, placeholderValues ?? {});\n\t\tthis.logger.logQuery(this.query.sql, params);\n\t\treturn this.prisma.$queryRawUnsafe(this.query.sql, ...params);\n\t}\n\n\toverride all(): Promise<unknown> {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\n\toverride isResponseInArrayMode(): boolean {\n\t\treturn false;\n\t}\n}\n\nexport interface PrismaPgSessionOptions {\n\tlogger?: Logger;\n}\n\nexport class PrismaPgSession extends PgSession {\n\tstatic override readonly [entityKind]: string = 'PrismaPgSession';\n\n\tprivate readonly logger: Logger;\n\n\tconstructor(\n\t\tdialect: PgDialect,","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/drizzle-team/drizzle-orm/blob/b7862528fd8fc39bc2653a6c18dad7c1f4e68d10/drizzle-orm/src/prisma/pg/session.ts#L16-L52","documentation":"PrismaPgPreparedQuery.all() throws 'Method not implemented.' The Prisma PostgreSQL adapter routes execution through $queryRawUnsafe and intentionally does not implement the all() variant (used for raw row arrays in some internal paths). isResponseInArrayMode() is also overridden to return false, reflecting that Prisma returns objects, not field-ordered arrays.","triggerScenarios":"Calling preparedQuery.all() directly, or hitting an internal Drizzle code path that selects all() on a PrismaPgPreparedQuery. Some migrate/ introspection helpers and certain dialect-specific code paths invoke all().","commonSituations":"Running migrations or CLI tooling against a Prisma-backed PostgreSQL Drizzle instance. Custom code calling the prepared query's all() method.","solutions":["Use execute() (db.select()/db.execute()) which is the implemented path through $queryRawUnsafe.","Use a native Drizzle PostgreSQL driver (postgres-js, node-postgres) for migrations and any path needing all().","Avoid session-level all() calls in application code; prefer the query builder."],"exampleFix":"// before (throws)\nawait preparedQuery.all();\n\n// after\nawait preparedQuery.execute();","handlingStrategy":"validation","validationCode":"import { entityKind } from 'drizzle-orm/entity';\n\nfunction isPrismaPgPrepared(q: any): boolean {\n  return q?.[entityKind] === 'PrismaPgPreparedQuery';\n}\n\nconst rows = isPrismaPgPrepared(stmt) ? await stmt.execute() : await stmt.all();","typeGuard":"function isPrismaPgPreparedQuery(q: unknown): boolean {\n  return (q as any)?.[Symbol.for('drizzle:entityKind')] === 'PrismaPgPreparedQuery';\n}","tryCatchPattern":"try {\n  await preparedQuery.all();\n} catch (e) {\n  if (e instanceof Error && e.message === 'Method not implemented.') {\n    await preparedQuery.execute();\n  } else throw e;\n}","preventionTips":["Use execute()/select()/execute() with the Prisma PG adapter; avoid .all().","Run migrations through a native Postgres driver.","Keep adapter capability differences documented for your team."],"tags":["prisma","postgres","not-implemented","adapter","prepared-query"],"analyzedSha":"b7862528fd8fc39bc2653a6c18dad7c1f4e68d10","analyzedAt":"2026-08-03T18:11:14.318Z","schemaVersion":2}