Skip to content

Conversation

@AmanVarshney01
Copy link
Contributor

@AmanVarshney01 AmanVarshney01 commented Nov 1, 2025

Summary by CodeRabbit

  • Chores

    • Switched ORM integrations to a PostgreSQL adapter across projects.
    • Added centralized Prisma configuration files to standardize migrations and seeding.
    • Updated dotenv for improved environment-variable handling.
    • Removed embedded package-level Prisma seed script entries across projects.
  • New Features

    • Context objects updated to include a pub/sub instance where applicable.

@coderabbitai
Copy link

coderabbitai bot commented Nov 1, 2025

Walkthrough

Replace Prisma Accelerate extension with @prisma/adapter-pg across example projects: update package.json dependencies, add per-package prisma.config.ts, switch seed and runtime PrismaClient initialization to use a PrismaPg pool adapter, and update context/Service/README wiring accordingly.

Changes

Cohort / File(s) Change Summary
Package manifests
orm/*/package.json (e.g., orm/fastify-graphql-sdl-first/package.json, orm/fastify-graphql/package.json, orm/graphql-auth/package.json, orm/graphql-nexus/package.json, orm/graphql-sdl-first/package.json, orm/graphql-subscriptions/package.json, orm/graphql/package.json, orm/hapi-graphql*/package.json, orm/nest-graphql*/package.json, orm/nextjs-graphql/package.json, ...)
Replace @prisma/extension-accelerate with @prisma/adapter-pg; add/update dotenv in devDependencies; remove top-level prisma seed blocks.
Prisma config files (new)
orm/*/prisma.config.ts (e.g., orm/fastify-graphql/prisma.config.ts, orm/graphql-nexus/prisma.config.ts, orm/nextjs-graphql/prisma.config.ts, ...)
Add prisma.config.ts exporting default defineConfig with schema, migrations (path + seed tsx ./prisma/seed.ts), engine: 'classic', and datasource.url = env('DATABASE_URL'); load dotenv.
Seed scripts
orm/*/prisma/seed.ts (multiple packages)
Replace withAccelerate import/usage with PrismaPg from @prisma/adapter-pg; create new PrismaPg({ connectionString: process.env.DATABASE_URL! }) pool and initialize new PrismaClient({ adapter: pool }). Seeding logic unchanged.
Context / DB initialization
orm/*/src/context.ts, orm/graphql/src/db.ts, orm/nextjs-graphql/lib/prisma.ts, ...
Remove withAccelerate usage; add PrismaPg import; instantiate pool from DATABASE_URL; construct PrismaClient({ adapter: pool }) instead of .$extends(withAccelerate()).
Subscription context update
orm/graphql-subscriptions/src/context.ts
Apply adapter changes and expand exported Context and context to include pubsub alongside prisma.
NestJS service changes
orm/nest-graphql/src/prisma.service.ts
Add constructor to initialize PrismaPg pool and configure PrismaClient with adapter; remove prior extendedPrismaClient() method.
Documentation updates
orm/*/README.md (e.g., orm/fastify-graphql/README.md, orm/nest-graphql/README.md, orm/nextjs-graphql/README.md)
Replace Accelerate extension instructions with @prisma/adapter-pg usage, update DATABASE_URL examples to standard Postgres URLs, and remove extension-specific steps.

Sequence Diagram(s)

sequenceDiagram
    participant App as Application
    participant Adapter as PrismaPg Adapter
    participant PC as PrismaClient
    participant DB as PostgreSQL

    rect rgb(245,245,255)
    note right of PC: BEFORE — extension-based init
    App->>PC: new PrismaClient()
    PC->>PC: .$extends(withAccelerate())
    PC->>DB: connect (accelerate)
    end

    rect rgb(235,255,235)
    note right of Adapter: AFTER — adapter-pg init
    App->>Adapter: new PrismaPg({ connectionString })
    Adapter->>Adapter: create pool
    App->>PC: new PrismaClient({ adapter: pool })
    PC->>Adapter: use pool
    Adapter->>DB: connect (postgres)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25–35 minutes

  • Focus review on:
    • Consistent usage and loading of DATABASE_URL/dotenv across packages.
    • Correct seed path in new prisma.config.ts files and presence of matching prisma/seed.ts.
    • NestJS PrismaService constructor implications for lifecycle/DI.
    • Context/db singletons and typing changes (especially subscription pubsub addition).

Possibly related PRs

Pre-merge checks

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: updating GraphQL examples to use prisma.config.ts and the @prisma/adapter-pg package instead of the Accelerate extension.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 04bc76d and 6538867.

📒 Files selected for processing (9)
  • orm/fastify-graphql-sdl-first/package.json (2 hunks)
  • orm/graphql-auth/package.json (2 hunks)
  • orm/graphql-nexus/package.json (2 hunks)
  • orm/graphql-sdl-first/package.json (2 hunks)
  • orm/graphql-subscriptions/package.json (2 hunks)
  • orm/hapi-graphql-sdl-first/package.json (2 hunks)
  • orm/hapi-graphql/package.json (2 hunks)
  • orm/nest-graphql-sdl-first/package.json (2 hunks)
  • orm/nest-graphql/package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
  • orm/hapi-graphql-sdl-first/package.json
  • orm/hapi-graphql/package.json
  • orm/graphql-sdl-first/package.json
  • orm/fastify-graphql-sdl-first/package.json
  • orm/nest-graphql/package.json
  • orm/graphql-subscriptions/package.json
  • orm/nest-graphql-sdl-first/package.json
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: aidankmcalister
Repo: prisma/prisma-examples PR: 8334
File: orm/betterauth-astro/src/pages/sign-up/index.astro:20-36
Timestamp: 2025-10-24T17:50:48.569Z
Learning: Do not suggest code changes or improvements to code in Prisma example repositories (prisma/prisma-examples). These examples are carefully set up and intentionally aligned with external documentation and information.
Learnt from: aidankmcalister
Repo: prisma/prisma-examples PR: 8334
File: orm/fastify-graphql-sdl-first/src/context.ts:1-1
Timestamp: 2025-10-27T13:18:46.546Z
Learning: The prisma/prisma-examples repository is a monorepo containing many independent example projects. When reviewing PRs in this repository, focus only on the files actually changed by the author in that specific PR, not on other example projects or infrastructure that wasn't modified.
Learnt from: FGoessler
Repo: prisma/prisma-examples PR: 8260
File: generator-prisma-client/nextjs-starter-webpack-turborepo/packages/database/package.json:13-13
Timestamp: 2025-08-22T12:12:24.602Z
Learning: When analyzing changes from package.json seed scripts to "prisma db seed", always verify the actual content of prisma.config.ts rather than relying solely on regex patterns, as the configuration may be properly defined but in a format that doesn't match overly restrictive search patterns.
📚 Learning: 2025-08-22T12:12:24.602Z
Learnt from: FGoessler
Repo: prisma/prisma-examples PR: 8260
File: generator-prisma-client/nextjs-starter-webpack-turborepo/packages/database/package.json:13-13
Timestamp: 2025-08-22T12:12:24.602Z
Learning: When analyzing changes from package.json seed scripts to "prisma db seed", always verify the actual content of prisma.config.ts rather than relying solely on regex patterns, as the configuration may be properly defined but in a format that doesn't match overly restrictive search patterns.

Applied to files:

  • orm/graphql-nexus/package.json
  • orm/graphql-auth/package.json
📚 Learning: 2025-10-15T13:58:59.096Z
Learnt from: AmanVarshney01
Repo: prisma/prisma-examples PR: 8327
File: orm/graphql-auth/prisma/schema.prisma:2-4
Timestamp: 2025-10-15T13:58:59.096Z
Learning: The "prisma-client" generator provider (introduced in Prisma v6) is the newer, ESM-ready alternative to "prisma-client-js". It requires an explicit output path and is better suited for modern runtimes, edge deployments, and will become the default in Prisma v7. Use "prisma-client" for new projects or when modernizing existing projects.

Applied to files:

  • orm/graphql-nexus/package.json
  • orm/graphql-auth/package.json
📚 Learning: 2025-10-27T13:18:46.546Z
Learnt from: aidankmcalister
Repo: prisma/prisma-examples PR: 8334
File: orm/fastify-graphql-sdl-first/src/context.ts:1-1
Timestamp: 2025-10-27T13:18:46.546Z
Learning: The prisma/prisma-examples repository is a monorepo containing many independent example projects. When reviewing PRs in this repository, focus only on the files actually changed by the author in that specific PR, not on other example projects or infrastructure that wasn't modified.

Applied to files:

  • orm/graphql-nexus/package.json
  • orm/graphql-auth/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test (orm/grpc)
🔇 Additional comments (2)
orm/graphql-auth/package.json (1)

20-23: Dependencies properly updated for adapter migration.

The changes align with the PR objective: @prisma/adapter-pg 6.18.0 is added alongside @prisma/client 6.18.0 (versions matched for compatibility), and related utility versions (bcryptjs, dotenv) are updated appropriately. The removal of the prisma seed block is consistent with the migration to prisma.config.ts-based configuration.

orm/graphql-nexus/package.json (1)

21-22: All changes verified and correct.

The migration from Accelerate to adapter-pg is properly implemented: prisma.config.ts correctly imports dotenv and defines the seed configuration, while prisma/seed.ts uses the PrismaPg adapter with environment variables. The seed configuration has been successfully moved from package.json to prisma.config.ts, and the dotenv duplication flagged in the earlier review is resolved.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 12

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
orm/nest-graphql-sdl-first/package.json (1)

40-51: Ship the pg driver with the adapter.

@prisma/adapter-pg expects a pg Pool/Client, but this manifest doesn’t install pg, so runtime seeding and server start will crash with “Cannot find module 'pg'”. Add pg as a regular dependency so the adapter can establish connections.

orm/hapi-graphql/package.json (1)

14-25: Missing pg dependency for the adapter.

This package now uses @prisma/adapter-pg, but it still doesn’t declare the required pg driver. Without it the application will immediately fail to resolve the module. Add pg to the dependencies.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 37abebc and c313b45.

📒 Files selected for processing (44)
  • orm/fastify-graphql-sdl-first/package.json (2 hunks)
  • orm/fastify-graphql-sdl-first/prisma.config.ts (1 hunks)
  • orm/fastify-graphql-sdl-first/prisma/seed.ts (1 hunks)
  • orm/fastify-graphql-sdl-first/src/context.ts (1 hunks)
  • orm/fastify-graphql/README.md (3 hunks)
  • orm/fastify-graphql/package.json (2 hunks)
  • orm/fastify-graphql/prisma.config.ts (1 hunks)
  • orm/fastify-graphql/prisma/seed.ts (1 hunks)
  • orm/fastify-graphql/src/context.ts (1 hunks)
  • orm/graphql-auth/package.json (2 hunks)
  • orm/graphql-auth/prisma.config.ts (1 hunks)
  • orm/graphql-auth/prisma/seed.ts (1 hunks)
  • orm/graphql-auth/src/context.ts (1 hunks)
  • orm/graphql-nexus/package.json (1 hunks)
  • orm/graphql-nexus/prisma.config.ts (1 hunks)
  • orm/graphql-nexus/prisma/seed.ts (1 hunks)
  • orm/graphql-nexus/src/context.ts (1 hunks)
  • orm/graphql-sdl-first/package.json (1 hunks)
  • orm/graphql-sdl-first/prisma.config.ts (1 hunks)
  • orm/graphql-sdl-first/prisma/seed.ts (1 hunks)
  • orm/graphql-sdl-first/src/context.ts (1 hunks)
  • orm/graphql-subscriptions/package.json (2 hunks)
  • orm/graphql-subscriptions/prisma.config.ts (1 hunks)
  • orm/graphql-subscriptions/prisma/seed.ts (1 hunks)
  • orm/graphql-subscriptions/src/context.ts (1 hunks)
  • orm/graphql/package.json (1 hunks)
  • orm/graphql/prisma.config.ts (1 hunks)
  • orm/graphql/prisma/seed.ts (1 hunks)
  • orm/graphql/src/db.ts (1 hunks)
  • orm/hapi-graphql-sdl-first/package.json (1 hunks)
  • orm/hapi-graphql-sdl-first/prisma/seed.ts (1 hunks)
  • orm/hapi-graphql-sdl-first/src/context.ts (1 hunks)
  • orm/hapi-graphql/package.json (2 hunks)
  • orm/hapi-graphql/prisma/seed.ts (1 hunks)
  • orm/hapi-graphql/src/context.ts (1 hunks)
  • orm/nest-graphql-sdl-first/package.json (2 hunks)
  • orm/nest-graphql-sdl-first/prisma.config.ts (1 hunks)
  • orm/nest-graphql-sdl-first/prisma/seed.ts (1 hunks)
  • orm/nest-graphql-sdl-first/src/context.ts (1 hunks)
  • orm/nest-graphql/README.md (3 hunks)
  • orm/nest-graphql/package.json (3 hunks)
  • orm/nest-graphql/prisma.config.ts (1 hunks)
  • orm/nest-graphql/prisma/seed.ts (1 hunks)
  • orm/nest-graphql/src/prisma.service.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: aidankmcalister
Repo: prisma/prisma-examples PR: 8334
File: orm/betterauth-astro/src/pages/sign-up/index.astro:20-36
Timestamp: 2025-10-24T17:50:48.569Z
Learning: Do not suggest code changes or improvements to code in Prisma example repositories (prisma/prisma-examples). These examples are carefully set up and intentionally aligned with external documentation and information.
Learnt from: aidankmcalister
Repo: prisma/prisma-examples PR: 8334
File: orm/fastify-graphql-sdl-first/src/context.ts:1-1
Timestamp: 2025-10-27T13:18:46.546Z
Learning: The prisma/prisma-examples repository is a monorepo containing many independent example projects. When reviewing PRs in this repository, focus only on the files actually changed by the author in that specific PR, not on other example projects or infrastructure that wasn't modified.
Learnt from: FGoessler
Repo: prisma/prisma-examples PR: 8260
File: generator-prisma-client/nextjs-starter-webpack-turborepo/packages/database/package.json:13-13
Timestamp: 2025-08-22T12:12:24.602Z
Learning: When analyzing changes from package.json seed scripts to "prisma db seed", always verify the actual content of prisma.config.ts rather than relying solely on regex patterns, as the configuration may be properly defined but in a format that doesn't match overly restrictive search patterns.
📚 Learning: 2025-08-22T12:12:43.161Z
Learnt from: FGoessler
Repo: prisma/prisma-examples PR: 8260
File: generator-prisma-client/nextjs-starter-turbopack/components/quotes.tsx:1-1
Timestamp: 2025-08-22T12:12:43.161Z
Learning: In Next.js applications using Prisma, the connection() function from 'next/server' serves a different purpose than 'export const dynamic = force-dynamic'. The connection() function ensures proper database connection context and request isolation, while dynamic = 'force-dynamic' only controls rendering strategy. Both should be used together and are not redundant.

Applied to files:

  • orm/fastify-graphql-sdl-first/src/context.ts
  • orm/nest-graphql-sdl-first/prisma/seed.ts
  • orm/hapi-graphql-sdl-first/prisma/seed.ts
  • orm/nest-graphql/src/prisma.service.ts
  • orm/hapi-graphql/src/context.ts
  • orm/hapi-graphql/prisma/seed.ts
  • orm/graphql-sdl-first/prisma/seed.ts
  • orm/graphql/prisma/seed.ts
  • orm/graphql-subscriptions/src/context.ts
  • orm/nest-graphql-sdl-first/src/context.ts
  • orm/graphql-sdl-first/src/context.ts
  • orm/graphql-auth/prisma/seed.ts
  • orm/fastify-graphql/prisma/seed.ts
  • orm/graphql-nexus/prisma/seed.ts
  • orm/graphql-nexus/src/context.ts
  • orm/graphql-subscriptions/prisma/seed.ts
  • orm/graphql-auth/src/context.ts
  • orm/fastify-graphql/src/context.ts
  • orm/hapi-graphql-sdl-first/src/context.ts
  • orm/graphql/src/db.ts
  • orm/nest-graphql/prisma/seed.ts
  • orm/fastify-graphql-sdl-first/prisma/seed.ts
📚 Learning: 2025-10-15T13:56:01.807Z
Learnt from: AmanVarshney01
Repo: prisma/prisma-examples PR: 8327
File: orm/graphql-subscriptions/prisma/schema.prisma:1-5
Timestamp: 2025-10-15T13:56:01.807Z
Learning: In Prisma v6.15 and later, `engineType = "client"` is a valid generator configuration value that generates a Prisma client without Rust engine binaries, relying on JavaScript driver adapters instead (e.g., prisma/adapter-pg). This is useful for edge and serverless deployments.

Applied to files:

  • orm/fastify-graphql-sdl-first/src/context.ts
  • orm/fastify-graphql-sdl-first/package.json
  • orm/nest-graphql-sdl-first/prisma/seed.ts
  • orm/hapi-graphql-sdl-first/prisma/seed.ts
  • orm/hapi-graphql/src/context.ts
  • orm/hapi-graphql/prisma/seed.ts
  • orm/graphql-sdl-first/prisma/seed.ts
  • orm/graphql/prisma/seed.ts
  • orm/graphql-subscriptions/src/context.ts
  • orm/nest-graphql-sdl-first/src/context.ts
  • orm/graphql-sdl-first/src/context.ts
  • orm/graphql-auth/prisma/seed.ts
  • orm/fastify-graphql/prisma/seed.ts
  • orm/graphql-nexus/prisma/seed.ts
  • orm/nest-graphql/README.md
  • orm/graphql-nexus/src/context.ts
  • orm/graphql-subscriptions/prisma/seed.ts
  • orm/graphql-auth/src/context.ts
  • orm/fastify-graphql/src/context.ts
  • orm/hapi-graphql-sdl-first/src/context.ts
  • orm/fastify-graphql/README.md
  • orm/graphql/src/db.ts
  • orm/nest-graphql/prisma/seed.ts
  • orm/fastify-graphql-sdl-first/prisma/seed.ts
📚 Learning: 2025-10-15T13:58:29.130Z
Learnt from: AmanVarshney01
Repo: prisma/prisma-examples PR: 8327
File: orm/fastify-graphql/prisma/schema.prisma:2-4
Timestamp: 2025-10-15T13:58:29.130Z
Learning: In Prisma v6.15 and later, `provider = "prisma-client"` is a valid generator configuration value when combined with `engineType = "client"`. This configuration generates a Prisma client without Rust engine binaries, relying on JavaScript driver adapters instead, and is different from the traditional `provider = "prisma-client-js"` configuration.

Applied to files:

  • orm/fastify-graphql-sdl-first/src/context.ts
  • orm/fastify-graphql-sdl-first/package.json
  • orm/nest-graphql-sdl-first/prisma/seed.ts
  • orm/fastify-graphql/prisma.config.ts
  • orm/hapi-graphql-sdl-first/prisma/seed.ts
  • orm/nest-graphql/src/prisma.service.ts
  • orm/graphql-auth/prisma.config.ts
  • orm/hapi-graphql/src/context.ts
  • orm/hapi-graphql/prisma/seed.ts
  • orm/nest-graphql-sdl-first/prisma.config.ts
  • orm/graphql-nexus/prisma.config.ts
  • orm/graphql-sdl-first/prisma/seed.ts
  • orm/graphql/prisma.config.ts
  • orm/graphql/prisma/seed.ts
  • orm/graphql-subscriptions/src/context.ts
  • orm/nest-graphql-sdl-first/src/context.ts
  • orm/fastify-graphql-sdl-first/prisma.config.ts
  • orm/graphql-sdl-first/src/context.ts
  • orm/graphql-auth/prisma/seed.ts
  • orm/fastify-graphql/prisma/seed.ts
  • orm/graphql-nexus/prisma/seed.ts
  • orm/graphql-subscriptions/prisma.config.ts
  • orm/nest-graphql/README.md
  • orm/graphql-sdl-first/prisma.config.ts
  • orm/graphql-nexus/src/context.ts
  • orm/graphql-subscriptions/prisma/seed.ts
  • orm/nest-graphql/prisma.config.ts
  • orm/graphql-auth/src/context.ts
  • orm/fastify-graphql/src/context.ts
  • orm/hapi-graphql-sdl-first/src/context.ts
  • orm/fastify-graphql/README.md
  • orm/graphql/src/db.ts
  • orm/nest-graphql/prisma/seed.ts
  • orm/fastify-graphql-sdl-first/prisma/seed.ts
📚 Learning: 2025-08-22T12:12:24.602Z
Learnt from: FGoessler
Repo: prisma/prisma-examples PR: 8260
File: generator-prisma-client/nextjs-starter-webpack-turborepo/packages/database/package.json:13-13
Timestamp: 2025-08-22T12:12:24.602Z
Learning: When analyzing changes from package.json seed scripts to "prisma db seed", always verify the actual content of prisma.config.ts rather than relying solely on regex patterns, as the configuration may be properly defined but in a format that doesn't match overly restrictive search patterns.

Applied to files:

  • orm/fastify-graphql-sdl-first/src/context.ts
  • orm/fastify-graphql-sdl-first/package.json
  • orm/nest-graphql-sdl-first/prisma/seed.ts
  • orm/fastify-graphql/prisma.config.ts
  • orm/hapi-graphql-sdl-first/prisma/seed.ts
  • orm/nest-graphql/src/prisma.service.ts
  • orm/graphql-auth/prisma.config.ts
  • orm/hapi-graphql/src/context.ts
  • orm/hapi-graphql/prisma/seed.ts
  • orm/graphql-auth/package.json
  • orm/nest-graphql-sdl-first/prisma.config.ts
  • orm/nest-graphql-sdl-first/package.json
  • orm/graphql-nexus/prisma.config.ts
  • orm/graphql-sdl-first/prisma/seed.ts
  • orm/graphql/prisma.config.ts
  • orm/graphql/prisma/seed.ts
  • orm/graphql/package.json
  • orm/nest-graphql-sdl-first/src/context.ts
  • orm/fastify-graphql-sdl-first/prisma.config.ts
  • orm/nest-graphql/package.json
  • orm/graphql-auth/prisma/seed.ts
  • orm/fastify-graphql/prisma/seed.ts
  • orm/hapi-graphql/package.json
  • orm/fastify-graphql/package.json
  • orm/graphql-nexus/prisma/seed.ts
  • orm/graphql-subscriptions/prisma.config.ts
  • orm/nest-graphql/README.md
  • orm/graphql-sdl-first/prisma.config.ts
  • orm/graphql-nexus/src/context.ts
  • orm/graphql-subscriptions/prisma/seed.ts
  • orm/hapi-graphql-sdl-first/package.json
  • orm/nest-graphql/prisma.config.ts
  • orm/graphql-auth/src/context.ts
  • orm/fastify-graphql/src/context.ts
  • orm/graphql-nexus/package.json
  • orm/fastify-graphql/README.md
  • orm/graphql-subscriptions/package.json
  • orm/graphql/src/db.ts
  • orm/nest-graphql/prisma/seed.ts
  • orm/fastify-graphql-sdl-first/prisma/seed.ts
  • orm/graphql-sdl-first/package.json
📚 Learning: 2025-10-15T13:58:59.096Z
Learnt from: AmanVarshney01
Repo: prisma/prisma-examples PR: 8327
File: orm/graphql-auth/prisma/schema.prisma:2-4
Timestamp: 2025-10-15T13:58:59.096Z
Learning: The "prisma-client" generator provider (introduced in Prisma v6) is the newer, ESM-ready alternative to "prisma-client-js". It requires an explicit output path and is better suited for modern runtimes, edge deployments, and will become the default in Prisma v7. Use "prisma-client" for new projects or when modernizing existing projects.

Applied to files:

  • orm/fastify-graphql-sdl-first/src/context.ts
  • orm/fastify-graphql-sdl-first/package.json
  • orm/nest-graphql-sdl-first/prisma/seed.ts
  • orm/fastify-graphql/prisma.config.ts
  • orm/hapi-graphql-sdl-first/prisma/seed.ts
  • orm/nest-graphql/src/prisma.service.ts
  • orm/graphql-auth/prisma.config.ts
  • orm/hapi-graphql/src/context.ts
  • orm/hapi-graphql/prisma/seed.ts
  • orm/graphql-auth/package.json
  • orm/nest-graphql-sdl-first/prisma.config.ts
  • orm/nest-graphql-sdl-first/package.json
  • orm/graphql-nexus/prisma.config.ts
  • orm/graphql-sdl-first/prisma/seed.ts
  • orm/graphql/prisma.config.ts
  • orm/graphql/prisma/seed.ts
  • orm/graphql/package.json
  • orm/graphql-subscriptions/src/context.ts
  • orm/nest-graphql-sdl-first/src/context.ts
  • orm/fastify-graphql-sdl-first/prisma.config.ts
  • orm/nest-graphql/package.json
  • orm/graphql-sdl-first/src/context.ts
  • orm/graphql-auth/prisma/seed.ts
  • orm/fastify-graphql/prisma/seed.ts
  • orm/hapi-graphql/package.json
  • orm/fastify-graphql/package.json
  • orm/graphql-nexus/prisma/seed.ts
  • orm/graphql-subscriptions/prisma.config.ts
  • orm/graphql-sdl-first/prisma.config.ts
  • orm/graphql-nexus/src/context.ts
  • orm/graphql-subscriptions/prisma/seed.ts
  • orm/hapi-graphql-sdl-first/package.json
  • orm/nest-graphql/prisma.config.ts
  • orm/graphql-auth/src/context.ts
  • orm/fastify-graphql/src/context.ts
  • orm/graphql-nexus/package.json
  • orm/hapi-graphql-sdl-first/src/context.ts
  • orm/graphql-subscriptions/package.json
  • orm/graphql/src/db.ts
  • orm/nest-graphql/prisma/seed.ts
  • orm/fastify-graphql-sdl-first/prisma/seed.ts
  • orm/graphql-sdl-first/package.json
📚 Learning: 2025-10-27T13:18:46.546Z
Learnt from: aidankmcalister
Repo: prisma/prisma-examples PR: 8334
File: orm/fastify-graphql-sdl-first/src/context.ts:1-1
Timestamp: 2025-10-27T13:18:46.546Z
Learning: In the prisma/prisma-examples repository, generated Prisma client files (typically at paths like `prisma/generated/client`) are intentionally not committed to the repository. These files are generated at build/test time. Do not flag missing generated client artifacts as issues in reviews.

Applied to files:

  • orm/nest-graphql-sdl-first/prisma/seed.ts
  • orm/fastify-graphql/prisma.config.ts
  • orm/hapi-graphql-sdl-first/prisma/seed.ts
  • orm/hapi-graphql/prisma/seed.ts
  • orm/nest-graphql-sdl-first/prisma.config.ts
  • orm/graphql-sdl-first/prisma/seed.ts
  • orm/graphql/prisma/seed.ts
  • orm/fastify-graphql-sdl-first/prisma.config.ts
  • orm/graphql-auth/prisma/seed.ts
  • orm/fastify-graphql/prisma/seed.ts
  • orm/graphql-nexus/prisma/seed.ts
  • orm/graphql-subscriptions/prisma/seed.ts
  • orm/nest-graphql/prisma/seed.ts
  • orm/fastify-graphql-sdl-first/prisma/seed.ts
📚 Learning: 2025-10-27T13:18:46.546Z
Learnt from: aidankmcalister
Repo: prisma/prisma-examples PR: 8334
File: orm/fastify-graphql-sdl-first/src/context.ts:1-1
Timestamp: 2025-10-27T13:18:46.546Z
Learning: The prisma/prisma-examples repository is a monorepo containing many independent example projects. When reviewing PRs in this repository, focus only on the files actually changed by the author in that specific PR, not on other example projects or infrastructure that wasn't modified.

Applied to files:

  • orm/nest-graphql-sdl-first/package.json
  • orm/nest-graphql/package.json
📚 Learning: 2025-10-24T17:50:48.569Z
Learnt from: aidankmcalister
Repo: prisma/prisma-examples PR: 8334
File: orm/betterauth-astro/src/pages/sign-up/index.astro:20-36
Timestamp: 2025-10-24T17:50:48.569Z
Learning: Do not suggest code changes or improvements to code in Prisma example repositories (prisma/prisma-examples). These examples are carefully set up and intentionally aligned with external documentation and information.

Applied to files:

  • orm/nest-graphql/README.md
  • orm/fastify-graphql/README.md
🧬 Code graph analysis (22)
orm/fastify-graphql-sdl-first/src/context.ts (2)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
orm/nest-graphql-sdl-first/prisma/seed.ts (2)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
orm/hapi-graphql-sdl-first/prisma/seed.ts (2)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
orm/nest-graphql/src/prisma.service.ts (1)
orm/nest/src/prisma.service.ts (1)
  • Injectable (5-15)
orm/hapi-graphql/src/context.ts (2)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
orm/hapi-graphql/prisma/seed.ts (2)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
orm/graphql-sdl-first/prisma/seed.ts (2)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
orm/graphql/prisma/seed.ts (1)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/graphql-subscriptions/src/context.ts (2)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
orm/nest-graphql-sdl-first/src/context.ts (2)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
orm/graphql-sdl-first/src/context.ts (2)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
orm/graphql-auth/prisma/seed.ts (1)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/fastify-graphql/prisma/seed.ts (3)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/prisma-mocking-javascript/client.js (1)
  • prisma (3-3)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
orm/graphql-nexus/prisma/seed.ts (3)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/prisma-mocking-javascript/client.js (1)
  • prisma (3-3)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
orm/graphql-nexus/src/context.ts (2)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
orm/graphql-subscriptions/prisma/seed.ts (2)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
orm/graphql-auth/src/context.ts (3)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/prisma-mocking-javascript/client.js (1)
  • prisma (3-3)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
orm/fastify-graphql/src/context.ts (2)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
orm/hapi-graphql-sdl-first/src/context.ts (2)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
orm/graphql/src/db.ts (3)
orm/nuxt/prisma/db.ts (1)
  • prisma (15-15)
orm/prisma-mocking-javascript/client.js (1)
  • prisma (3-3)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
orm/nest-graphql/prisma/seed.ts (2)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
orm/fastify-graphql-sdl-first/prisma/seed.ts (2)
orm/graphql/src/db.ts (1)
  • prisma (5-5)
orm/testing-express/src/app.ts (1)
  • prisma (5-5)
🪛 Biome (2.1.2)
orm/graphql-auth/package.json

[error] 39-40: Expected a property but instead found '}'.

Expected a property here.

(parse)

orm/nest-graphql-sdl-first/package.json

[error] 81-82: Expected a property but instead found '}'.

Expected a property here.

(parse)

orm/nest-graphql/package.json

[error] 80-81: Expected a property but instead found '}'.

Expected a property here.

(parse)

orm/hapi-graphql/package.json

[error] 33-34: Expected a property but instead found '}'.

Expected a property here.

(parse)

orm/graphql-subscriptions/package.json

[error] 41-42: Expected a property but instead found '}'.

Expected a property here.

(parse)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)
  • GitHub Check: test (orm/ai-sdk-nextjs)
  • GitHub Check: test (orm/betterauth-nextjs)
  • GitHub Check: test (orm/fastify)
  • GitHub Check: test (orm/astro)
  • GitHub Check: test (orm/authjs-nextjs)
  • GitHub Check: test (orm/clerk-nextjs)
  • GitHub Check: test (orm/hapi)
  • GitHub Check: test (orm/betterauth-astro)
  • GitHub Check: test (orm/hapi-graphql-sdl-first)
  • GitHub Check: test (orm/koa)
  • GitHub Check: test (orm/nextjs-graphql)
  • GitHub Check: test (orm/grpc)
  • GitHub Check: test (orm/react-router-7)
  • GitHub Check: test (orm/nextjs-trpc)
  • GitHub Check: test (orm/nest)
  • GitHub Check: test (orm/nextjs)
  • GitHub Check: test (orm/nuxt)
  • GitHub Check: test (orm/solid-start)
🔇 Additional comments (35)
orm/fastify-graphql-sdl-first/src/context.ts (1)

1-5: LGTM! Clean migration to adapter-based approach.

The migration from Prisma Accelerate extension to the PrismaPg adapter is correctly implemented. The pool initialization and adapter configuration follow the expected pattern for the @prisma/adapter-pg driver.

orm/nest-graphql-sdl-first/src/context.ts (1)

2-6: LGTM! Consistent adapter implementation.

The adapter-based initialization matches the migration pattern used across other packages in this PR. The pool configuration and PrismaClient setup are correct.

orm/graphql-nexus/prisma/seed.ts (1)

2-5: LGTM! Seed file correctly migrated to adapter approach.

The PrismaClient initialization has been properly updated to use the PrismaPg adapter while preserving all seeding logic unchanged.

orm/nest-graphql/src/prisma.service.ts (1)

3-10: LGTM! NestJS service correctly adapted.

The constructor-based initialization is the appropriate pattern for NestJS services extending PrismaClient. The pool is correctly initialized and passed to the superclass via the adapter option.

orm/hapi-graphql/src/context.ts (1)

1-5: LGTM! Adapter migration correctly applied.

The implementation follows the same correct pattern used across other context files in this PR.

orm/fastify-graphql/package.json (2)

10-10: Dependency correctly updated to adapter-pg.

The migration from @prisma/extension-accelerate to @prisma/adapter-pg aligns with the PR objectives.


20-20: dotenv devDependency added.

The dotenv package is appropriately added to devDependencies for environment variable loading during development.

orm/graphql/package.json (2)

22-22: Dependency correctly updated to adapter-pg.

The migration from @prisma/extension-accelerate to @prisma/adapter-pg is consistent with the PR's migration strategy.


30-30: dotenv devDependency updated.

The dotenv version update to ^17.2.1 is appropriate.

orm/graphql-subscriptions/package.json (2)

22-22: Dependency correctly updated to adapter-pg.

The migration from @prisma/extension-accelerate to @prisma/adapter-pg follows the PR's migration pattern.


37-37: dotenv devDependency added.

The dotenv package is correctly added to devDependencies.

orm/graphql/src/db.ts (1)

1-5: Adapter wiring omits the pg driver.

The exported Prisma client uses new PrismaPg({ connectionString: ... }), which never produces a real driver. Replace this with a pg Pool/Client instance (from the pg package) passed into new PrismaPg(pool) so the adapter can open connections, and ensure the dependency is declared.

⛔ Skipped due to learnings
Learnt from: AmanVarshney01
Repo: prisma/prisma-examples PR: 8327
File: orm/graphql-subscriptions/prisma/schema.prisma:1-5
Timestamp: 2025-10-15T13:56:01.807Z
Learning: In Prisma v6.15 and later, `engineType = "client"` is a valid generator configuration value that generates a Prisma client without Rust engine binaries, relying on JavaScript driver adapters instead (e.g., prisma/adapter-pg). This is useful for edge and serverless deployments.
Learnt from: AmanVarshney01
Repo: prisma/prisma-examples PR: 8327
File: orm/fastify-graphql/prisma/schema.prisma:2-4
Timestamp: 2025-10-15T13:58:29.130Z
Learning: In Prisma v6.15 and later, `provider = "prisma-client"` is a valid generator configuration value when combined with `engineType = "client"`. This configuration generates a Prisma client without Rust engine binaries, relying on JavaScript driver adapters instead, and is different from the traditional `provider = "prisma-client-js"` configuration.
Learnt from: AmanVarshney01
Repo: prisma/prisma-examples PR: 8327
File: orm/graphql-auth/prisma/schema.prisma:2-4
Timestamp: 2025-10-15T13:58:59.096Z
Learning: The "prisma-client" generator provider (introduced in Prisma v6) is the newer, ESM-ready alternative to "prisma-client-js". It requires an explicit output path and is better suited for modern runtimes, edge deployments, and will become the default in Prisma v7. Use "prisma-client" for new projects or when modernizing existing projects.
Learnt from: FGoessler
Repo: prisma/prisma-examples PR: 8260
File: generator-prisma-client/nextjs-starter-turbopack/components/quotes.tsx:1-1
Timestamp: 2025-08-22T12:12:43.161Z
Learning: In Next.js applications using Prisma, the connection() function from 'next/server' serves a different purpose than 'export const dynamic = force-dynamic'. The connection() function ensures proper database connection context and request isolation, while dynamic = 'force-dynamic' only controls rendering strategy. Both should be used together and are not redundant.
orm/graphql-subscriptions/prisma/seed.ts (1)

4-5: Adapter is created from a config object instead of a pg Pool.

PrismaPg must wrap a pg Pool/Client instance; giving it a plain options object leaves the adapter without a driver, so every Prisma call will fail. Create a Pool (or Client) from the pg package and pass that into new PrismaPg(...) before instantiating PrismaClient, and ensure pg is installed.

⛔ Skipped due to learnings
Learnt from: AmanVarshney01
Repo: prisma/prisma-examples PR: 8327
File: orm/fastify-graphql/prisma/schema.prisma:2-4
Timestamp: 2025-10-15T13:58:29.130Z
Learning: In Prisma v6.15 and later, `provider = "prisma-client"` is a valid generator configuration value when combined with `engineType = "client"`. This configuration generates a Prisma client without Rust engine binaries, relying on JavaScript driver adapters instead, and is different from the traditional `provider = "prisma-client-js"` configuration.
Learnt from: AmanVarshney01
Repo: prisma/prisma-examples PR: 8327
File: orm/graphql-subscriptions/prisma/schema.prisma:1-5
Timestamp: 2025-10-15T13:56:01.807Z
Learning: In Prisma v6.15 and later, `engineType = "client"` is a valid generator configuration value that generates a Prisma client without Rust engine binaries, relying on JavaScript driver adapters instead (e.g., prisma/adapter-pg). This is useful for edge and serverless deployments.
Learnt from: AmanVarshney01
Repo: prisma/prisma-examples PR: 8327
File: orm/graphql-auth/prisma/schema.prisma:2-4
Timestamp: 2025-10-15T13:58:59.096Z
Learning: The "prisma-client" generator provider (introduced in Prisma v6) is the newer, ESM-ready alternative to "prisma-client-js". It requires an explicit output path and is better suited for modern runtimes, edge deployments, and will become the default in Prisma v7. Use "prisma-client" for new projects or when modernizing existing projects.
Learnt from: FGoessler
Repo: prisma/prisma-examples PR: 8260
File: generator-prisma-client/nextjs-starter-turbopack/components/quotes.tsx:1-1
Timestamp: 2025-08-22T12:12:43.161Z
Learning: In Next.js applications using Prisma, the connection() function from 'next/server' serves a different purpose than 'export const dynamic = force-dynamic'. The connection() function ensures proper database connection context and request isolation, while dynamic = 'force-dynamic' only controls rendering strategy. Both should be used together and are not redundant.
orm/nest-graphql-sdl-first/prisma.config.ts (1)

1-14: LGTM!

The Prisma configuration correctly uses the new defineConfig pattern with proper schema path, migration configuration including seed script, classic engine type, and environment-based datasource URL.

orm/graphql/prisma/seed.ts (1)

2-5: LGTM!

The migration from Prisma Accelerate extension to the @prisma/adapter-pg driver adapter is correctly implemented. The adapter pool is properly initialized with the database connection string, and PrismaClient is configured with the adapter option.

orm/nest-graphql/prisma/seed.ts (1)

2-5: LGTM!

The migration to @prisma/adapter-pg is correctly implemented, following the same pattern used across other examples in this PR.

orm/fastify-graphql-sdl-first/prisma/seed.ts (1)

2-5: LGTM!

The adapter-based PrismaClient initialization is correctly implemented, consistent with the migration pattern throughout this PR.

orm/graphql-subscriptions/src/context.ts (1)

1-6: LGTM!

The context file correctly migrates to the adapter-based approach. The PrismaClient initialization now uses the @prisma/adapter-pg driver adapter while maintaining the same public API through the Context interface.

orm/graphql-sdl-first/prisma/seed.ts (1)

2-5: LGTM!

The adapter-based initialization is correctly implemented, completing the consistent migration pattern across all GraphQL examples in this PR.

orm/fastify-graphql/README.md (1)

75-89: LGTM! Documentation correctly reflects adapter-based setup.

The CLI output example accurately demonstrates the migration from Prisma Accelerate to the @prisma/adapter-pg driver adapter, including proper installation and initialization patterns.

orm/nest-graphql/README.md (1)

75-89: LGTM! Consistent migration to adapter-based approach.

The documentation updates correctly reflect the migration pattern established across the GraphQL examples.

orm/hapi-graphql-sdl-first/prisma/seed.ts (1)

2-5: LGTM! Proper adapter-based PrismaClient initialization.

The migration from Prisma Accelerate extension to @prisma/adapter-pg is implemented correctly, maintaining the seed logic while updating only the client initialization.

orm/graphql-sdl-first/prisma.config.ts (1)

1-14: LGTM! Proper Prisma configuration module.

The configuration correctly defines the schema, migrations, seed command, and datasource settings, aligning with the adapter-based migration pattern.

orm/fastify-graphql/prisma/seed.ts (1)

2-5: LGTM! Consistent adapter-based initialization.

The seed file correctly implements the PrismaPg adapter pattern, consistent with the migration across all GraphQL examples.

orm/graphql-subscriptions/prisma.config.ts (1)

1-14: LGTM! Consistent Prisma configuration.

The configuration file follows the established pattern and is correctly configured for the adapter-based approach.

orm/fastify-graphql/prisma.config.ts (1)

1-14: LGTM! Standard Prisma configuration.

The configuration file is correctly structured and consistent with the adapter-based migration pattern used throughout the PR.

orm/graphql-nexus/src/context.ts (1)

1-5: LGTM! Clean migration to adapter-based approach.

The migration from withAccelerate() to the @prisma/adapter-pg driver adapter is correctly implemented. The pool initialization and PrismaClient configuration follow the expected pattern for this architectural change.

orm/graphql-auth/src/context.ts (1)

1-5: LGTM! Adapter migration correctly applied.

The PrismaPg adapter setup is properly configured, maintaining the existing Context interface while migrating away from the Accelerate extension.

orm/nest-graphql/prisma.config.ts (1)

1-14: LGTM! Prisma configuration properly structured.

The configuration correctly defines the schema, migrations with seed script, classic engine, and environment-based datasource URL. This aligns with the adapter-based migration across the monorepo.

orm/graphql-nexus/prisma.config.ts (1)

1-14: LGTM! Configuration matches the project-wide pattern.

The Prisma configuration is correctly structured and consistent with other examples in this migration.

orm/fastify-graphql-sdl-first/prisma.config.ts (1)

1-14: LGTM! Standard Prisma configuration.

The configuration is properly defined and follows the established pattern for adapter-based Prisma setup.

orm/hapi-graphql-sdl-first/src/context.ts (1)

1-5: LGTM! Adapter-based setup correctly implemented.

The migration to @prisma/adapter-pg is properly configured, maintaining the existing public API while updating the underlying implementation.

orm/graphql-auth/prisma.config.ts (1)

1-14: LGTM! Configuration follows the standard pattern.

The Prisma configuration is correctly structured with proper seed script, engine, and datasource settings.

orm/graphql-auth/package.json (2)

21-21: Dependency correctly updated for adapter migration.

The addition of @prisma/adapter-pg properly supports the migration from the Accelerate extension to the PostgreSQL driver adapter.


35-35: Dotenv devDependency added for configuration support.

The dotenv package addition supports the new prisma.config.ts environment variable loading pattern.

coderabbitai[bot]
coderabbitai bot previously approved these changes Nov 3, 2025
@AmanVarshney01 AmanVarshney01 changed the base branch from latest to prisma-7 November 7, 2025 11:39
@AmanVarshney01 AmanVarshney01 merged commit 161ae5c into prisma-7 Nov 14, 2025
35 of 47 checks passed
@AmanVarshney01 AmanVarshney01 deleted the dc-5004-prisma-examples-update-graphql-examples-22 branch November 14, 2025 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants