Skip to content

Conversation

@AmanVarshney01
Copy link
Contributor

@AmanVarshney01 AmanVarshney01 commented Nov 2, 2025

Summary by CodeRabbit

Release Notes

  • New Features

    • Migrated database connectivity from extension-based to native PostgreSQL driver adapter for improved performance and direct database access.
  • Dependencies

    • Updated Prisma to v6.18.0 with new adapter-based architecture.
    • Added PostgreSQL driver adapter support.
    • Replaced legacy extension system with modern adapter pattern.
    • Upgraded TypeScript tooling with ESNext module support.
  • Configuration

    • Database connection URLs now use standard PostgreSQL format.
    • Updated environment configuration structure for adapter setup.

@coderabbitai
Copy link

coderabbitai bot commented Nov 2, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This PR systematically updates six ORM examples (Express, Fastify, gRPC, Hapi, Koa, Nest) to replace Prisma Accelerate extension with the PostgreSQL adapter. Changes include: migrating from ts-node to tsx, adding prisma.config.ts files, updating Prisma generator configuration (provider, output, engineType), updating database URLs from prisma+postgres:// format, and bumping Prisma to 6.18.0 with PrismaPg adapter.

Changes

Cohort / File(s) Summary
Documentation Updates
orm/express/README.md, orm/fastify/README.md, orm/grpc/README.md, orm/hapi/README.md, orm/koa/README.md, orm/nest/README.md
Replaced Prisma Accelerate extension workflow with PostgreSQL adapter guidance. Updated connection URL examples from prisma+postgres:// to postgresql://user:password@host:port/database. Added new section on configuring PrismaClient with PrismaPg adapter and connection pool.
Package Configuration
orm/express/package.json, orm/fastify/package.json, orm/grpc/package.json, orm/hapi/package.json, orm/koa/package.json, orm/nest/package.json
Updated dev script from ts-node to tsx. Bumped @prisma/client from 6.9.0 to 6.18.0. Replaced @prisma/extension-accelerate (removed) with @prisma/adapter-pg 6.18.0. Replaced ts-node and old prisma with tsx, prisma 6.18.0, and dotenv in devDependencies. Removed prisma seed configuration block.
Prisma Configuration Files
orm/express/prisma.config.ts, orm/fastify/prisma.config.ts, orm/grpc/prisma.config.ts, orm/hapi/prisma.config.ts, orm/koa/prisma.config.ts, orm/nest/prisma.config.ts
Added new Prisma configuration modules. Each exports defineConfig with schema, migrations (path, seed via tsx), engine (classic), and datasource URL from environment.
Prisma Schema Updates
orm/*/prisma/schema.prisma
Updated generator block: provider changed from prisma-client-js to prisma-client; added output = "./generated" and engineType = "client". Reordered field annotations in Post/User models (e.g., @id @default(autoincrement()) instead of @default(autoincrement()) @id).
Seed Scripts
orm/*/prisma/seed.ts
Replaced Prisma client import from @prisma/client to ./generated/client. Added PrismaPg adapter import and pool instantiation. Changed PrismaClient initialization from PrismaClient().$extends(withAccelerate()) to PrismaClient({ adapter: pool }) where pool is a PrismaPg instance. Added data clearing (deleteMany) for posts and users before seeding.
TypeScript Configuration
orm/*/tsconfig.json
Added compiler options: module: "ESNext", moduleResolution: "node", resolveJsonModule: true. Reformatted lib array to multi-line format.
Express Source Code
orm/express/src/index.ts
Updated imports to use generated client and PrismaPg adapter. Added dotenv import. Changed PrismaClient initialization to use adapter pattern with pool. Minor formatting adjustments to feed query OR condition.
Fastify Source Code
orm/fastify/src/index.ts
Same pattern as Express: updated imports, added dotenv, changed to adapter-based PrismaClient initialization with pool.
gRPC Source Code
orm/grpc/server/server.ts, orm/grpc/prisma/seed.ts
Updated server to use PrismaPg adapter instead of Accelerate extension. Added dotenv import. Changed PrismaClient({ adapter: pool }) initialization pattern.
Hapi Source Code
orm/hapi/src/index.ts, orm/hapi/src/plugins/prisma.ts, orm/hapi/src/plugins/users.ts, orm/hapi/src/plugins/posts.ts
Updated main to import dotenv. Modified prisma plugin to use PrismaPg pool in prismaClientSingleton. Updated imports in users and prisma plugin to use generated client path. Minor formatting in posts plugin (no functional change).
Koa Source Code
orm/koa/src/index.ts
Added dotenv import. Updated PrismaClient to use PrismaPg adapter pattern. Changed imports to generated client. Minor formatting in signup and feed query logic.
Nest Source Code
orm/nest/src/app.controller.ts, orm/nest/src/main.ts, orm/nest/src/prisma.service.ts
Updated controller and service imports to use generated client. Added dotenv import in main. Modified PrismaService constructor to instantiate PrismaPg pool and pass to super({ adapter: pool }). Removed extendedPrismaClient() method.

Sequence Diagram(s)

sequenceDiagram
    participant App as Application
    participant Client as PrismaClient
    participant Adapter as PrismaPg Adapter
    participant Pool as Connection Pool
    participant DB as PostgreSQL

    rect rgb(200, 220, 240)
    Note over App,DB: Previous Flow (Accelerate)
    App->>Client: new PrismaClient().$extends(withAccelerate())
    Client->>App: extended client instance
    App->>Client: query
    Client->>DB: (via Accelerate)
    end

    rect rgb(220, 240, 200)
    Note over App,DB: New Flow (Adapter-based)
    App->>Adapter: new PrismaPg({connectionString})
    Adapter->>Pool: create connection pool
    App->>Client: new PrismaClient({adapter: pool})
    Client->>App: client instance
    App->>Client: query
    Client->>Adapter: delegate via adapter
    Adapter->>Pool: get connection
    Pool->>DB: execute query
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Areas requiring extra attention:

  • Adapter initialization pattern consistency: Verify that all six frameworks correctly instantiate PrismaPg pool and pass it to PrismaClient({ adapter: pool }) with proper DATABASE_URL environment variable handling.
  • Generated client path imports: Ensure all files correctly import from ./generated/client or relative equivalents and that the Prisma generator output configuration is properly set to "./generated".
  • prisma.config.ts files: Confirm all new configuration files use correct seed script syntax (tsx prisma/seed.ts) and proper datasource URL resolution via env('DATABASE_URL').
  • Schema generator changes: Verify that the shift from prisma-client-js to prisma-client provider with engineType = "client" is intentional and compatible with the adapter usage pattern.
  • Data clearing logic: Review the pre-seeding deleteMany calls to ensure they work correctly with the new adapter configuration and don't break seeding workflows.
  • TypeScript configuration alignment: Confirm tsconfig changes (ESNext module, JSON module resolution) are compatible with tsx runner and generated client imports across all frameworks.

Possibly related PRs

  • #8289: Introduces PrismaPg adapter-based PrismaClient initialization pattern with pool creation and adapter wiring across examples.
  • #8260: Adds prisma.config.ts files and bumps Prisma tooling versions in example projects.
  • #8284: Modifies Prisma client wiring to use PostgreSQL driver adapter and construct PrismaClient with adapter option.

Pre-merge checks

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The PR title "Update HTTP web server examples" is vague and generic, using a non-descriptive action verb that fails to convey the specific nature of the changes. While the title technically refers to components being modified (HTTP server examples across multiple frameworks), it does not indicate the primary substantive change in the changeset: the migration from Prisma Accelerate to the PostgreSQL adapter, the dependency upgrades, or the tooling transition from ts-node to tsx. A developer scanning the git history would not understand what specifically was updated without reading the full PR description. Consider revising the title to be more specific about the primary changes, such as "Migrate HTTP examples from Prisma Accelerate to PostgreSQL adapter" or "Update HTTP server examples to use Prisma pg adapter and upgrade dependencies" to clearly communicate the key objective of this changeset to reviewers scanning the project history.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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.

coderabbitai[bot]
coderabbitai bot previously approved these changes Nov 2, 2025
mhartington
mhartington previously approved these changes Nov 3, 2025
@AmanVarshney01 AmanVarshney01 changed the base branch from latest to prisma-7 November 7, 2025 11:42
@AmanVarshney01 AmanVarshney01 merged commit c233671 into prisma-7 Nov 14, 2025
41 of 47 checks passed
@AmanVarshney01 AmanVarshney01 deleted the dc-5478-prisma-examples-update-http-web-server-examples-22 branch November 14, 2025 04:48
AmanVarshney01 added a commit that referenced this pull request Nov 19, 2025
* Update all accelerate example (#8373)

* Update misc examples (#8372)

* Update misc examples with prisma.config.ts and adapter (#8362)

* Update HTTP web server examples (#8354)

* update all nextjs examples in `generator-prisma-client/` (#8342)

* Update fullstack examples with prisma config and pg adapter (#8344)

Co-authored-by: Nurul Sundarani <sundarani@prisma.io>

* Update Nuxt & React Router examples (#8368)

* Update optimize examples (#8375)

* Update Bun & Deno examples (#8343)

* Update GraphQL examples with prisma.config.ts and pg adapter (#8345)

* update cockroachdb, postgresql-supabase, prisma-postgres examples (#8374)

* remove engine classic and url from schema.prisma

* update deployment

* update readme

* delete all lock files and update prisma version to 7.0.0

* update remaining examples

* update d1 example

* fix

* update turso example

* fix

* update nuxt example

* fix nextjs example

* update all deps to 7.0.0

* fix

---------

Co-authored-by: Nurul Sundarani <sundarani@prisma.io>
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