Skip to content

Conversation

@AmanVarshney01
Copy link
Contributor

@AmanVarshney01 AmanVarshney01 commented Oct 16, 2025

Summary by CodeRabbit

  • Chores

    • Upgraded Prisma tooling, enabled local generated clients and adapters/extensions, switched dev runner to tsx, and added dotenv for env loading.
  • Tests

    • Modernized test harness to ESM, introduced isolated test databases with setup/teardown, added DB cleanup and increased timeouts, and updated test scripts.
  • Documentation

    • Added .env example for database configuration.

@coderabbitai
Copy link

coderabbitai bot commented Oct 16, 2025

Walkthrough

Switches multiple examples to generate and import local Prisma clients (generator/provider/output/engineType changes), bumps Prisma tooling, replaces ts-node with tsx, adds dotenv and DB adapters/extensions in several projects, converts testing-express to ESM (Jest/tsconfig updates), and revises test and test-environment code to use DATABASE_URL and adapter-backed clients.

Changes

Cohort / File(s) Summary
Package manifests
orm/postgis-express/package.json, orm/prisma-mocking-javascript/package.json, orm/script/package.json, orm/starter/package.json, orm/testing-express/package.json, orm/typedsql/package.json
Replace ts-node with tsx in dev scripts/devDeps; bump @prisma/client/prisma; add dotenv and adapter/extension deps in some packages; add "type":"module" in testing-express; adjust seed/dev script commands.
Prisma generator config
orm/postgis-express/prisma/schema.prisma, orm/prisma-mocking-javascript/prisma/schema.prisma, orm/script/prisma/schema.prisma, orm/starter/prisma/schema.prisma, orm/typedsql/prisma/schema.prisma, orm/testing-express/prisma/schema.prisma
Generator provider changed from prisma-client-jsprisma-client; added output = "./generated" and engineType = "client" across schemas (models/datasources unchanged; minor whitespace/annotation-order edits).
Imports → generated client & dotenv
orm/postgis-express/src/server.ts, orm/postgis-express/prisma/test-environment.js, orm/script/script.ts, orm/starter/src/index.ts, orm/testing-express/src/app.ts, orm/testing-express/prisma/seed.ts, orm/typedsql/prisma/seed.ts, orm/typedsql/src/index.ts, orm/testing-express/src/index.ts
Replace imports of @prisma/client with local generated client paths (./prisma/generated/client or ../prisma/generated/client); add import 'dotenv/config' in several entrypoints to load env vars.
Adapter-backed / extended clients
orm/prisma-mocking-javascript/client.js, orm/postgis-express/src/server.ts, orm/testing-express/src/app.ts
Introduce DB adapters and/or extensions: better-sqlite3 adapter in prisma-mocking-javascript; PrismaPg adapter usage and adapter-backed PrismaClient in postgis-express; testing-express retains accelerate extension usage with generated client.
TS/tsconfig and ESM/Jest changes
orm/starter/tsconfig.json, orm/testing-express/tsconfig.json, orm/testing-express/jest.config.js, orm/testing-express/package.json
Adjust tsconfig rootDir/include/module/target; testing-express switched to ESM ("type":"module"), Jest config converted to ESM-compatible settings, and test run scripts updated for ESM/VM options.
Tests & test environment
orm/testing-express/tests/user.test.ts, orm/testing-express/prisma/prisma-test-environment.mjs, orm/testing-express/setupTests.ts, orm/postgis-express/prisma/test-environment.js
Tests updated to import .js, add DB cleanup beforeEach, convert tests to async assertions and explicit status/payload checks; test-environment rewritten to create/drop dedicated test databases using DATABASE_URL and adapter-backed Prisma clients.
Minor runtime / formatting adjustments
orm/postgis-express/src/server.ts (SQL param formatting), orm/testing-express/.env.example, orm/testing-express/src/index.ts, various seed files
Small SQL parameter/formatting tweaks, added .env.example DATABASE_URL template, adjusted import paths to .js, and minor reformatting in seed files.

Sequence Diagram(s)

sequenceDiagram
  participant App as App / Entrypoint
  participant GenClient as Generated Prisma Client
  participant Adapter as DB Adapter (optional)
  participant Ext as Extension (optional)
  participant DB as Database

  Note over App,GenClient: App imports generated client and may load dotenv/config

  App->>GenClient: instantiate new PrismaClient({ adapter? })
  alt adapter present
    GenClient->>Adapter: delegate DB I/O
    Adapter->>DB: execute SQL
    DB-->>Adapter: results
    Adapter-->>GenClient: results
  else
    GenClient->>DB: execute SQL
    DB-->>GenClient: results
  end

  alt extension present
    GenClient->>Ext: apply .$extends(withAccelerate() / similar)
    Ext-->>GenClient: extended client
  end

  App->>GenClient: run query (CRUD)
  GenClient-->>App: return results
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Heterogeneous change set: generator config, generated-client imports, adapters/extensions, dependency bumps, ESM/Jest migration, and test rewrites across multiple example projects.
  • Files needing extra attention:
    • orm/prisma-mocking-javascript/client.js — adapter instantiation and env handling.
    • orm/postgis-express/prisma/test-environment.js & orm/postgis-express/src/server.ts — test DB lifecycle, adapter usage, and PostGIS setup.
    • orm/testing-express — ESM Jest config, test lifecycle/timeouts, and database cleanup in tests.
    • Ensure generated output paths match updated import paths and that adapters/extensions are compatible with bumped Prisma versions.

Possibly related PRs

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 title "Update misc examples" uses vague and non-descriptive terminology that fails to communicate the actual purpose of the changes. The word "misc" explicitly indicates miscellaneous or mixed updates, and "update" is a generic verb that doesn't convey what is being modified or why. While the PR does update multiple example directories across the repository, the actual changes follow a cohesive pattern centered on upgrading Prisma to version 6.18.0, migrating to the new client generation system with generated output directories and adapters, replacing ts-node with tsx, and adding dotenv configuration. The title does not reflect this substantive objective. Consider revising the title to clearly communicate the primary objective, such as "Upgrade Prisma examples to 6.18.0 with adapter-based client generation" or "Migrate examples to Prisma 6.18.0 and update tooling to tsx". This would allow reviewers scanning the commit history to immediately understand the scope and purpose of the changes without opening the full PR details.
✅ 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.

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: 1

📜 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 f2ce042 and cc000d1.

📒 Files selected for processing (22)
  • orm/postgis-express/package.json (2 hunks)
  • orm/postgis-express/prisma/schema.prisma (1 hunks)
  • orm/postgis-express/prisma/test-environment.js (1 hunks)
  • orm/postgis-express/src/server.ts (1 hunks)
  • orm/prisma-mocking-javascript/client.js (1 hunks)
  • orm/prisma-mocking-javascript/package.json (1 hunks)
  • orm/prisma-mocking-javascript/prisma/schema.prisma (2 hunks)
  • orm/script/package.json (1 hunks)
  • orm/script/prisma/schema.prisma (1 hunks)
  • orm/script/script.ts (1 hunks)
  • orm/starter/package.json (1 hunks)
  • orm/starter/prisma/schema.prisma (1 hunks)
  • orm/starter/src/index.ts (1 hunks)
  • orm/starter/tsconfig.json (1 hunks)
  • orm/testing-express/package.json (2 hunks)
  • orm/testing-express/prisma/schema.prisma (1 hunks)
  • orm/testing-express/prisma/seed.ts (1 hunks)
  • orm/testing-express/src/app.ts (1 hunks)
  • orm/typedsql/package.json (1 hunks)
  • orm/typedsql/prisma/schema.prisma (1 hunks)
  • orm/typedsql/prisma/seed.ts (2 hunks)
  • orm/typedsql/src/index.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: AmanVarshney01
PR: prisma/prisma-examples#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.
📚 Learning: 2025-10-15T13:58:59.096Z
Learnt from: AmanVarshney01
PR: prisma/prisma-examples#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/testing-express/prisma/schema.prisma
  • orm/script/prisma/schema.prisma
  • orm/starter/prisma/schema.prisma
  • orm/prisma-mocking-javascript/prisma/schema.prisma
  • orm/script/script.ts
  • orm/prisma-mocking-javascript/client.js
  • orm/testing-express/prisma/seed.ts
  • orm/typedsql/prisma/schema.prisma
  • orm/postgis-express/src/server.ts
  • orm/postgis-express/prisma/schema.prisma
📚 Learning: 2025-10-15T13:58:29.130Z
Learnt from: AmanVarshney01
PR: prisma/prisma-examples#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/testing-express/prisma/schema.prisma
  • orm/script/prisma/schema.prisma
  • orm/starter/prisma/schema.prisma
  • orm/prisma-mocking-javascript/prisma/schema.prisma
  • orm/typedsql/prisma/schema.prisma
  • orm/postgis-express/prisma/schema.prisma
📚 Learning: 2025-10-15T13:56:01.807Z
Learnt from: AmanVarshney01
PR: prisma/prisma-examples#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/testing-express/prisma/schema.prisma
  • orm/script/prisma/schema.prisma
  • orm/starter/prisma/schema.prisma
  • orm/prisma-mocking-javascript/prisma/schema.prisma
  • orm/typedsql/prisma/schema.prisma
  • orm/postgis-express/prisma/schema.prisma
📚 Learning: 2025-08-22T12:12:24.602Z
Learnt from: FGoessler
PR: prisma/prisma-examples#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/script/package.json
  • orm/testing-express/prisma/seed.ts
  • orm/testing-express/package.json
  • orm/typedsql/prisma/seed.ts
🧬 Code graph analysis (1)
orm/prisma-mocking-javascript/client.js (4)
orm/nuxt/prisma/seed.js (3)
  • require (1-1)
  • require (2-2)
  • prisma (4-4)
orm/prisma-mocking-javascript/singleton.js (2)
  • require (1-1)
  • require (3-3)
orm/prisma-mocking-javascript/functions-without-context.js (1)
  • require (1-1)
orm/prisma-mocking-javascript/__test__/with-singleton.test.js (2)
  • require (1-1)
  • require (2-2)
⏰ 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). (4)
  • GitHub Check: test (orm/grpc)
  • GitHub Check: test (orm/nest-graphql)
  • GitHub Check: test (orm/nest-graphql-sdl-first)
  • GitHub Check: test (orm/nuxt)
🔇 Additional comments (33)
orm/starter/tsconfig.json (2)

5-5: LGTM! Configuration aligns with generated client pattern.

The rootDir change from "./src" to "." correctly allows TypeScript to compile both source files and the generated Prisma client. This is necessary when using a locally generated client with output = "./generated" in the Prisma schema.


12-14: LGTM! Explicit include scope added.

The include array explicitly defines compilation scope, ensuring TypeScript picks up all necessary source files. This complements the rootDir change and maintains clear project boundaries.

orm/typedsql/prisma/schema.prisma (1)

2-3: LGTM! Modern generator configuration adopted.

The migration to provider = "prisma-client" with explicit output = "./generated" aligns with Prisma v6 best practices. This ESM-ready generator will become the default in Prisma v7 and better supports modern runtimes.

Note: Unlike some other examples in this PR (e.g., orm/testing-express/prisma/schema.prisma), this schema doesn't include engineType = "client". This may be intentional for the typedSql preview feature. If adapter-based deployments are planned, consider adding it for consistency.

Based on learnings.

orm/typedsql/prisma/seed.ts (2)

1-1: LGTM! Import path updated for generated client.

The import path correctly references the new locally generated Prisma client location, aligning with the output = "./generated" configuration in orm/typedsql/prisma/schema.prisma.


70-74: LGTM! Formatting improvement.

The object literal reformatting improves readability. The satisfies operator ensures type safety without changing runtime behavior.

orm/postgis-express/package.json (4)

6-6: LGTM! Modern TypeScript execution with tsx.

The switch from ts-node to tsx provides faster execution and better ESM support, aligning with modern Node.js practices.


10-10: LGTM! Prisma upgraded to 6.17.1.

The Prisma dependency upgrade from 6.9.0 to ^6.17.1 includes important fixes, notably the 6.17.1 patch that addresses regressions in Unsupported type handling. The caret (^) range allows automatic patch updates while preventing breaking changes.

Based on learnings.

Also applies to: 23-23


27-27: LGTM! tsx replaces ts-node.

The tsx devDependency provides faster TypeScript execution with zero configuration, replacing the older ts-node approach.


12-12: LGTM – dotenv is properly initialized
import 'dotenv/config' in server.ts ensures .env variables load at startup.

orm/script/package.json (4)

5-5: LGTM! Modern execution with tsx.

The switch to tsx from ts-node provides faster TypeScript execution and better ESM compatibility.


11-11: LGTM! dotenv support added.

The dotenv dependency enables environment variable loading from .env files, essential for database connection strings and configuration.


14-15: LGTM! Updated devDependencies.

The Prisma CLI upgrade to ^6.17.1 and addition of tsx support the modern development workflow.


8-9: LGTM: Accelerate extension initialized

withAccelerate is properly imported and applied in orm/script/script.ts. Ensure Node.js 18+ and prisma:// connection URLs for optimal performance.

orm/prisma-mocking-javascript/package.json (2)

15-15: LGTM! Prisma CLI upgraded.

The Prisma CLI upgrade to ^6.17.1 includes the latest fixes and features, maintaining version alignment with the client and adapter.


7-7: Approve dev script update. client.js found and properly initializes PrismaClient with PrismaBetterSQLite3 adapter.

orm/starter/package.json (2)

14-15: LGTM! Updated devDependencies.

The Prisma CLI and tsx upgrades to ^6.17.1 and ^4.20.6 respectively provide the latest stable tooling with flexibility for patch updates.


19-21: LGTM! Runtime dependencies updated.

The runtime dependencies are upgraded to current stable versions:

  • @prisma/client ^6.17.1: includes latest fixes
  • @prisma/extension-accelerate ^2.0.2: enables connection pooling and caching (requires Node 18+)
  • dotenv ^16.4.7: enables environment configuration

All versions align with the broader modernization effort across examples.

Based on learnings.

orm/testing-express/prisma/schema.prisma (1)

2-4: Verify JavaScript driver adapter is installed and used

No @prisma/adapter-* imports were found in your code. Confirm that a compatible JS adapter (e.g. @prisma/adapter-pg) is listed in package.json and correctly imported/extended on your PrismaClient instances.

orm/starter/prisma/schema.prisma (1)

4-8: LGTM! Modern Prisma v6 generator configuration.

The migration to provider = "prisma-client" with explicit output and engineType = "client" follows Prisma v6+ best practices. This configuration generates an ESM-ready client without Rust engine binaries, making it suitable for modern runtimes and edge deployments.

Based on learnings.

orm/script/prisma/schema.prisma (1)

1-5: LGTM! Consistent generator configuration.

The generator configuration matches the modernization pattern applied across all examples in this PR, ensuring consistency.

Based on learnings.

orm/postgis-express/prisma/test-environment.js (1)

5-5: LGTM! Import path correctly updated.

The import path change to the locally generated client aligns with the updated Prisma generator configuration.

orm/postgis-express/src/server.ts (1)

1-2: LGTM! Environment loading and client import correctly updated.

The addition of dotenv/config ensures environment variables are loaded before Prisma client initialization. The import path correctly points to the locally generated client.

orm/script/script.ts (1)

1-2: LGTM! Environment loading and client import correctly updated.

The changes properly integrate dotenv for environment variable loading and update the import path to use the locally generated Prisma client.

orm/testing-express/src/app.ts (1)

1-2: LGTM! Environment loading and client import correctly updated.

The changes align with the migration pattern applied across all examples, ensuring environment variables are loaded and the locally generated Prisma client is used.

orm/testing-express/prisma/seed.ts (1)

1-1: LGTM! Import path correctly updated.

The import path change to use the locally generated client is correct and aligns with the updated Prisma generator configuration.

orm/starter/src/index.ts (1)

1-2: LGTM! Environment loading and client import correctly updated.

The changes complete the migration to the locally generated Prisma client with proper environment variable loading, consistent with the pattern applied across all examples in this PR.

orm/typedsql/src/index.ts (1)

1-4: LGTM! Import paths correctly updated to use generated client.

The imports now reference the locally generated Prisma client and SQL helpers, consistent with the schema.prisma generator changes across the PR.

Based on learnings.

orm/postgis-express/prisma/schema.prisma (1)

2-4: LGTM! Generator configuration correctly modernized.

The generator has been updated to use "prisma-client" with explicit output path and engineType = "client", which is the recommended configuration for Prisma v6.15+ that enables JS driver adapters and is better suited for modern runtimes and edge deployments.

Based on learnings.

orm/prisma-mocking-javascript/prisma/schema.prisma (1)

2-4: LGTM! Generator configuration correctly modernized.

The generator has been updated to use "prisma-client" with explicit output path and engineType = "client", consistent with the broader migration across the repository.

Based on learnings.

orm/prisma-mocking-javascript/client.js (1)

1-5: Verify DATABASE_URL is loaded before client initialization.

The client now uses the better-sqlite3 adapter with process.env.DATABASE_URL. Ensure that dotenv is loaded at the application entry point before this module is imported, otherwise the adapter initialization will fail.

For entry points that import this client, add:

require('dotenv/config')

at the very beginning of the file, before any other imports.

orm/testing-express/package.json (3)

6-6: LGTM! Migration from ts-node to tsx.

The dev script has been correctly updated to use tsx, which is faster and more modern than ts-node.


14-15: LGTM! Dependencies updated consistently.

All Prisma-related packages are aligned at version ^6.17.1, tsx replaces ts-node, and dotenv is added for environment variable support. The versions are consistent and appropriate for the migration.

Also applies to: 17-17, 29-29, 32-32


36-36: LGTM! Seed script updated to use tsx.

The seed script has been correctly updated to use tsx instead of ts-node, consistent with the dev script changes.

coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 16, 2025
mhartington
mhartington previously approved these changes Oct 17, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 27, 2025
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: 1

🧹 Nitpick comments (9)
orm/testing-express/.env.example (1)

1-1: Drop quotes to satisfy dotenv-linter and common .env style

Quotes aren’t needed and are flagged by dotenv-linter. Use an unquoted URL.

-DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE"
+DATABASE_URL=postgresql://USER:PASSWORD@HOST:PORT/DATABASE
orm/testing-express/prisma/prisma-test-environment.mjs (2)

17-23: Make Prisma CLI execution cross‑platform and robust

On Windows the binary is prisma.cmd, and quoting path handles spaces. Build the command accordingly.

 const prismaBinary = path.join(
   __dirname,
   '..',
   'node_modules',
   '.bin',
   'prisma',
 )
+
+// Cross-platform command (adds .cmd on Windows) and quotes the path
+const prismaCmd = process.platform === 'win32' ? `${prismaBinary}.cmd` : prismaBinary
-    await execAsync(`${prismaBinary} db push --skip-generate`)
+    await execAsync(`"${prismaCmd}" db push --skip-generate`)

Also applies to: 41-41


45-52: Call super.teardown() to complete Jest environment cleanup

Without it, resources may linger. Call it after unlink.

   async teardown() {
     // Clean up the test database file
     try {
       await fs.promises.unlink(this.dbPath)
     } catch (error) {
       // doesn't matter as the environment is torn down
     }
+    await super.teardown()
   }
orm/testing-express/setupTests.ts (1)

1-3: Prefer central timeout in Jest config to avoid drift with per‑test overrides

You set 10s here, while tests specify 60s. Consider configuring testTimeout in jest.config.js and removing per‑test timeouts for consistency.

orm/testing-express/tsconfig.json (1)

6-12: Adopt TS ESM ergonomics: bundler/NodeNext resolution and verbatim module syntax

This improves .js import paths and ESM interop with tsx/ts-jest.

   "strict": true,
   "lib": [
     "esnext"
   ],
   "esModuleInterop": true,
-  "module": "ESNext",
-  "moduleResolution": "node",
+  "module": "ESNext",
+  "moduleResolution": "Bundler",
+  "verbatimModuleSyntax": true,
+  "allowImportingTsExtensions": true,
   "target": "ES2020"
orm/testing-express/jest.config.js (1)

9-16: Set a single, central test timeout to avoid per‑test 60s overrides

Add testTimeout: 10000 (or your preferred value) here to keep consistency and drop per‑test timeouts.

 const config = {
   preset: 'ts-jest/presets/default-esm',
   moduleFileExtensions: ['js', 'json', 'ts', 'mjs'],
   testEnvironment: join(__dirname, 'prisma', 'prisma-test-environment.mjs'),
   setupFilesAfterEnv: ['<rootDir>/setupTests.ts'],
+  testTimeout: 10000,
   extensionsToTreatAsEsm: ['.ts'],
   moduleNameMapper: {
     '^(\\.{1,2}/.*)\\.js$': '$1',
   },
 }
orm/testing-express/tests/user.test.ts (3)

5-8: DB cleanup is good; consider wrapping in a transaction if more tables are added

For now deleteMany on users is fine. If relations get added, prefer a single $transaction clearing all models for atomic, faster cleanup.

await prisma.$transaction([
  prisma.user.deleteMany(),
  // future: prisma.post.deleteMany(), etc.
])

32-48: Make duplicate‑email assertions resilient to implementation details

If the route ever changes its message, this test will fail despite correct 409 handling. Recommend asserting conflict status and a stable signal (e.g., Prisma code P2002 or substring match).

- expect(duplicateResponse.status).toBe(409)
- expect(duplicateResponse.body.error).toBe('User already exists!')
+ expect(duplicateResponse.status).toBe(409)
+ expect(typeof duplicateResponse.body.error).toBe('string')
+ expect(duplicateResponse.body.error.toLowerCase()).toContain('exist')
+ // Optional if you bubble Prisma code:
+ // expect(duplicateResponse.body.code).toBe('P2002')

Please confirm the API consistently returns 409 and either a stable error code or message substring.


50-77: Avoid relying on list order; assert exact returned emails instead

Order isn’t guaranteed without orderBy. Assert the set of emails equals the created set.

-  expect(response.body.length).toBe(3)
-  expect(response.body[0].email).toBeDefined()
-  expect(response.body[1].email).toBeDefined()
-  expect(response.body[2].email).toBeDefined()
+  expect(response.body.length).toBe(3)
+  const returned = new Set(response.body.map((u: any) => u.email))
+  const expected = new Set(users.map((u) => u.email))
+  expect(returned).toEqual(expected)

Also, consider removing the per‑test 60000 timeouts and relying on the central Jest timeout.

📜 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 167245a and e3a040a.

📒 Files selected for processing (10)
  • orm/testing-express/.env.example (1 hunks)
  • orm/testing-express/jest.config.js (1 hunks)
  • orm/testing-express/package.json (2 hunks)
  • orm/testing-express/prisma/prisma-test-environment.mjs (2 hunks)
  • orm/testing-express/prisma/schema.prisma (1 hunks)
  • orm/testing-express/setupTests.ts (1 hunks)
  • orm/testing-express/src/app.ts (1 hunks)
  • orm/testing-express/src/index.ts (1 hunks)
  • orm/testing-express/tests/user.test.ts (2 hunks)
  • orm/testing-express/tsconfig.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • orm/testing-express/prisma/schema.prisma
  • orm/testing-express/src/app.ts
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-22T12:12:24.602Z
Learnt from: FGoessler
PR: prisma/prisma-examples#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/testing-express/package.json
🧬 Code graph analysis (3)
orm/testing-express/jest.config.js (1)
orm/testing-express/prisma/prisma-test-environment.mjs (2)
  • __filename (14-14)
  • __dirname (15-15)
orm/testing-express/tests/user.test.ts (1)
orm/testing-express/src/app.ts (2)
  • prisma (5-5)
  • app (6-6)
orm/testing-express/prisma/prisma-test-environment.mjs (2)
orm/postgis-express/prisma/test-environment.js (1)
  • exec (4-4)
orm/testing-express/jest.config.js (1)
  • __dirname (5-5)
🪛 dotenv-linter (4.0.0)
orm/testing-express/.env.example

[warning] 1-1: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)

⏰ 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). (29)
  • GitHub Check: test (orm/astro)
  • GitHub Check: test (orm/fastify-graphql)
  • GitHub Check: test (orm/clerk-nextjs)
  • GitHub Check: test (orm/betterauth-nextjs)
  • GitHub Check: test (orm/fastify)
  • GitHub Check: test (orm/fastify-graphql-sdl-first)
  • GitHub Check: test (orm/grpc)
  • GitHub Check: test (orm/authjs-nextjs)
  • GitHub Check: test (orm/graphql-nexus)
  • GitHub Check: test (orm/express)
  • GitHub Check: test (orm/ai-sdk-nextjs)
  • GitHub Check: test (orm/graphql-sdl-first)
  • GitHub Check: test (orm/hapi-graphql)
  • GitHub Check: test (orm/graphql)
  • GitHub Check: test (orm/koa)
  • GitHub Check: test (orm/graphql-auth)
  • GitHub Check: test (orm/graphql-subscriptions)
  • GitHub Check: test (orm/hapi-graphql-sdl-first)
  • GitHub Check: test (orm/nextjs-trpc)
  • GitHub Check: test (orm/hono)
  • GitHub Check: test (orm/hapi)
  • GitHub Check: test (orm/nextjs-graphql)
  • GitHub Check: test (orm/nest-graphql)
  • GitHub Check: test (orm/nest)
  • GitHub Check: test (orm/nest-graphql-sdl-first)
  • GitHub Check: test (orm/nextjs)
  • GitHub Check: test (orm/solid-start)
  • GitHub Check: test (orm/nuxt)
  • GitHub Check: test (orm/sveltekit)
🔇 Additional comments (4)
orm/testing-express/src/index.ts (1)

1-1: ESM import extension looks correct

Switching to './app.js' matches ESM resolution and the Jest ESM mapper. LGTM.

orm/testing-express/package.json (3)

37-37: Seed script update is aligned with tsx migration.

The seed script correctly updated from ts-node to tsx (line 37), matching the dev script and overall migration to a modern ESM-compatible runner. Ensure prisma/seed.ts uses ES module syntax.


5-5: No changes needed—ES module configuration is correctly implemented.

Verification confirms the configuration is sound:

  • ✓ All source files (src/app.ts, src/index.ts, prisma/seed.ts, prisma/prisma-test-environment.mjs) consistently use ES module syntax (import/export)
  • ✓ No CommonJS patterns detected
  • dotenv is properly added as a runtime dependency and correctly imported via import 'dotenv/config' in src/app.ts and prisma-test-environment.mjs
  • ✓ Scripts correctly use tsx and NODE_OPTIONS=--experimental-vm-modules for Jest ESM support
  • ✓ Prisma versions are consistent and compatible with extension-accelerate

15-16: All concerns verified as correct—no action required.

The verification confirms:

  • dotenv ^16.6.1 is correctly placed as a regular dependency since it's imported at runtime in app.ts
  • @prisma/extension-accelerate v2.0.2 is compatible with Prisma v6.17.1
  • tsx ^4.20.6 is properly configured as the dev script runner and compatible with the Jest/TypeScript setup

The package.json dependencies are correctly aligned and configured.

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: 2

📜 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 e3a040a and 8a4798b.

📒 Files selected for processing (5)
  • orm/postgis-express/package.json (2 hunks)
  • orm/script/package.json (1 hunks)
  • orm/starter/package.json (1 hunks)
  • orm/testing-express/package.json (2 hunks)
  • orm/typedsql/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • orm/typedsql/package.json
  • orm/postgis-express/package.json
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-22T12:12:24.602Z
Learnt from: FGoessler
PR: prisma/prisma-examples#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/script/package.json
  • orm/testing-express/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). (28)
  • GitHub Check: test (orm/koa)
  • GitHub Check: test (orm/ai-sdk-nextjs)
  • GitHub Check: test (orm/betterauth-astro)
  • GitHub Check: test (orm/authjs-nextjs)
  • GitHub Check: test (orm/clerk-nextjs)
  • GitHub Check: test (orm/astro)
  • GitHub Check: test (orm/fastify)
  • GitHub Check: test (orm/betterauth-nextjs)
  • GitHub Check: test (orm/express)
  • GitHub Check: test (orm/graphql-sdl-first)
  • GitHub Check: test (orm/fastify-graphql)
  • GitHub Check: test (orm/nest-graphql)
  • GitHub Check: test (orm/graphql-nexus)
  • GitHub Check: test (orm/graphql)
  • GitHub Check: test (orm/hapi-graphql)
  • GitHub Check: test (orm/hapi-graphql-sdl-first)
  • GitHub Check: test (orm/nuxt)
  • GitHub Check: test (orm/nest-graphql-sdl-first)
  • GitHub Check: test (orm/hapi)
  • GitHub Check: test (orm/grpc)
  • GitHub Check: test (orm/hono)
  • GitHub Check: test (orm/nest)
  • GitHub Check: test (orm/nextjs-graphql)
  • GitHub Check: test (orm/nextjs)
  • GitHub Check: test (orm/react-router-7)
  • GitHub Check: test (orm/nextjs-trpc)
  • GitHub Check: test (orm/solid-start)
  • GitHub Check: test (orm/testing-express)
🔇 Additional comments (4)
orm/starter/package.json (1)

14-21: Version consistency looks good; verify dotenv usage.

Prisma versions are aligned (^6.17.1), and the dependency specifications use consistent caret notation. Confirm that dotenv (line 21) is imported and used in the application code, as it's now a production dependency.

orm/script/package.json (1)

5-5: Tooling migration looks good; verify dotenv is used in code.

The switch from ts-node to tsx (line 5) is a solid modernization. Prisma versions are aligned (^6.18.0). However, confirm that dotenv (line 11) is imported and actively used in script.ts, as it's now a production dependency.

Also applies to: 8-11, 14-15

orm/testing-express/package.json (2)

5-5: Verify ES module code compatibility.

Adding "type": "module" (line 5) enables ES modules for the entire package. Ensure that your TypeScript code is compiled to ES modules and that all imports use the correct syntax (.js file extensions in relative imports).

Also applies to: 8-8


7-8: Tooling migration and Jest configuration look good.

The switch from ts-node to tsx (line 7) and the Jest NODE_OPTIONS flag (line 8) for ES module support are correct. The prisma seed update (line 37) is consistent. Confirm that Prisma versions (^6.18.0) align across the project.

Also applies to: 37-37

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: 3

Caution

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

⚠️ Outside diff range comments (1)
orm/postgis-express/src/server.ts (1)

55-62: Validate userId and distance; avoid NaN/falsey pitfalls and 500s.

parseInt inside the template can yield NaN, and || 5 turns 0 into 5. Parse/validate first, respond 400 on bad input.

-  const { d } = req.query
-  const distance = parseInt(String(d)) || 5
+  const { d } = req.query
+  const userIdInt = Number.parseInt(userId, 10)
+  if (!Number.isInteger(userIdInt) || userIdInt < 1) {
+    return res.status(400).json({ error: 'Invalid userId' })
+  }
+  const dParsed = d === undefined ? 5 : Number.parseInt(String(d), 10)
+  const distance = Number.isFinite(dParsed) && dParsed >= 0 ? dParsed : 5
   try {
     const locations = await prisma.$queryRaw`
-      select * from "locations_near_user"(${parseInt(
-      userId,
-    )}::int, ${distance}::int)
+      select * from "locations_near_user"(${userIdInt}::int, ${distance}::int)
     `
🧹 Nitpick comments (2)
orm/postgis-express/src/server.ts (2)

4-5: Accelerate + PG adapter combo is fine; note on caching.

This setup is solid. Note: withAccelerate won’t cache $queryRaw calls; that’s expected here.


16-24: Type the $queryRaw result instead of using any.

Avoid any and index safety issues by typing the row.

-    const response: any = (await prisma.$queryRaw`
-    
-    insert into "User" ("name", "location") values
-    (${name}, "public"."st_point"(${location.lng}, ${location.lat}))
-    returning id`) as any
+    const [row] = await prisma.$queryRaw<{ id: number }[]>`
+      insert into "User" ("name", "location") values
+      (${name}, "public"."st_point"(${location.lng}, ${location.lat}))
+      returning id
+    `
...
-      id: response[0].id,
+      id: row.id,
📜 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 8a4798b and 0eb18a8.

📒 Files selected for processing (3)
  • orm/postgis-express/package.json (2 hunks)
  • orm/postgis-express/src/server.ts (2 hunks)
  • orm/testing-express/prisma/schema.prisma (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • orm/testing-express/prisma/schema.prisma
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-15T13:58:59.096Z
Learnt from: AmanVarshney01
PR: prisma/prisma-examples#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/postgis-express/src/server.ts
🧬 Code graph analysis (1)
orm/postgis-express/src/server.ts (1)
orm/prisma-mocking-javascript/client.js (1)
  • adapter (4-4)
⏰ 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). (13)
  • GitHub Check: test (orm/astro)
  • GitHub Check: test (orm/ai-sdk-nextjs)
  • GitHub Check: test (orm/betterauth-astro)
  • GitHub Check: test (orm/express)
  • GitHub Check: test (orm/grpc)
  • GitHub Check: test (orm/graphql-nexus)
  • GitHub Check: test (orm/nest-graphql-sdl-first)
  • GitHub Check: test (orm/nextjs)
  • GitHub Check: test (orm/nuxt)
  • GitHub Check: test (orm/nextjs-graphql)
  • GitHub Check: test (orm/nest-graphql)
  • GitHub Check: test (orm/nest)
  • GitHub Check: test (orm/solid-start)
🔇 Additional comments (2)
orm/postgis-express/package.json (2)

6-6: Dev script modernization looks good.

The switch from ts-node to tsx aligns with the tooling updates and is a sensible modernization for running TypeScript in development.


10-12: New Prisma packages are properly imported and used in the codebase.

The verification confirms all three new dependencies are correctly integrated in orm/postgis-express/src/server.ts:

  • @prisma/adapter-pg is imported and passed to PrismaClient as an adapter
  • @prisma/extension-accelerate is imported and chained via $extends()
  • dotenv is imported as a side-effect to load environment variables

The implementation is correct.

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: 1

♻️ Duplicate comments (2)
orm/testing-express/prisma/prisma-test-environment.mjs (1)

28-31: DB file path mismatch causes leaked test DB files

DB_URL points to file:${this.dbName} (created in CWD where Jest runs), but this.dbPath targets path.join(__dirname, this.dbName) (prisma directory). Cleanup in teardown() will miss the actual file.

Align both paths to the same location:

 this.dbName = `test_${nanoid()}.db`
-process.env.DB_URL = `file:${this.dbName}`
-this.global.process.env.DB_URL = `file:${this.dbName}`
 this.dbPath = path.join(__dirname, this.dbName)
+process.env.DB_URL = `file:${this.dbPath}`
+this.global.process.env.DB_URL = `file:${this.dbPath}`
orm/postgis-express/src/server.ts (1)

1-7: Guard DB_URL to fail fast if missing

The adapter is initialized with process.env.DB_URL without checking if it's defined. If the environment variable is missing, the adapter may fail silently or produce cryptic errors at runtime.

Add a guard before creating the adapter:

 import 'dotenv/config'
 import { PrismaClient } from '../prisma/generated/client'
 import { PrismaPg } from "@prisma/adapter-pg"
 import express from 'express'
 
+const dbUrl = process.env.DB_URL
+if (!dbUrl) {
+  throw new Error('DB_URL environment variable is not set')
+}
-const adapter = new PrismaPg({ connectionString: process.env.DB_URL })
+const adapter = new PrismaPg({ connectionString: dbUrl })
 export const prisma = new PrismaClient({ adapter })
📜 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 0eb18a8 and e4cfb04.

⛔ Files ignored due to path filters (2)
  • orm/postgis-express/bun.lock is excluded by !**/*.lock
  • orm/testing-express/bun.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • orm/postgis-express/package.json (2 hunks)
  • orm/postgis-express/prisma/test-environment.js (2 hunks)
  • orm/postgis-express/src/server.ts (2 hunks)
  • orm/script/package.json (1 hunks)
  • orm/testing-express/package.json (2 hunks)
  • orm/testing-express/prisma/prisma-test-environment.mjs (1 hunks)
  • orm/testing-express/src/app.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
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: 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: 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-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.
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.
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.
📚 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/testing-express/prisma/prisma-test-environment.mjs
  • orm/postgis-express/prisma/test-environment.js
  • orm/testing-express/package.json
  • orm/postgis-express/package.json
  • orm/testing-express/src/app.ts
  • orm/postgis-express/src/server.ts
  • orm/script/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/testing-express/prisma/prisma-test-environment.mjs
  • orm/postgis-express/prisma/test-environment.js
  • orm/postgis-express/package.json
  • orm/postgis-express/src/server.ts
📚 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/postgis-express/prisma/test-environment.js
  • orm/testing-express/package.json
  • orm/postgis-express/package.json
  • orm/testing-express/src/app.ts
  • orm/postgis-express/src/server.ts
  • orm/script/package.json
📚 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/postgis-express/prisma/test-environment.js
  • orm/testing-express/src/app.ts
  • orm/postgis-express/src/server.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/postgis-express/prisma/test-environment.js
  • orm/postgis-express/package.json
  • orm/testing-express/src/app.ts
  • orm/postgis-express/src/server.ts
📚 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/postgis-express/prisma/test-environment.js
  • orm/testing-express/src/app.ts
  • orm/postgis-express/src/server.ts
📚 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/postgis-express/src/server.ts
🧬 Code graph analysis (1)
orm/postgis-express/src/server.ts (2)
orm/postgis-express/prisma/test-environment.js (1)
  • adapter (8-8)
orm/testing-express/src/app.ts (1)
  • prisma (6-6)
⏰ 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). (24)
  • GitHub Check: test (orm/authjs-nextjs)
  • GitHub Check: test (orm/graphql-sdl-first)
  • GitHub Check: test (orm/clerk-nextjs)
  • GitHub Check: test (orm/betterauth-astro)
  • GitHub Check: test (orm/betterauth-nextjs)
  • GitHub Check: test (orm/graphql)
  • GitHub Check: test (orm/ai-sdk-nextjs)
  • GitHub Check: test (orm/fastify-graphql)
  • GitHub Check: test (orm/graphql-nexus)
  • GitHub Check: test (orm/graphql-auth)
  • GitHub Check: test (orm/express)
  • GitHub Check: test (orm/grpc)
  • GitHub Check: test (orm/hapi-graphql-sdl-first)
  • GitHub Check: test (orm/nextjs)
  • GitHub Check: test (orm/hapi-graphql)
  • GitHub Check: test (orm/nest)
  • GitHub Check: test (orm/nextjs-graphql)
  • GitHub Check: test (orm/nest-graphql)
  • GitHub Check: test (orm/react-router-7)
  • GitHub Check: test (orm/postgis-express)
  • GitHub Check: test (orm/nuxt)
  • GitHub Check: test (orm/nest-graphql-sdl-first)
  • GitHub Check: test (orm/solid-start)
  • GitHub Check: test (orm/sveltekit)
🔇 Additional comments (10)
orm/testing-express/src/app.ts (1)

1-2: LGTM! Import changes align with PR objectives.

The addition of dotenv/config enables environment variable loading, and the switch to the locally generated Prisma client at ../prisma/generated/client.js is consistent with the PR-wide modernization to use local client generation with the newer ESM-ready approach.

orm/postgis-express/src/server.ts (1)

59-61: LGTM!

The formatting adjustment improves readability by placing userId on its own line.

orm/postgis-express/package.json (2)

6-6: LGTM!

Migration from ts-node to tsx for the dev script is appropriate and aligns with modern TypeScript tooling.


10-14: LGTM!

Dependencies correctly updated to support the generated Prisma client with adapter pattern. The addition of @prisma/adapter-pg, upgrade to @prisma/client ^6.18.0, and inclusion of dotenv align with the modernized setup.

orm/script/package.json (2)

5-5: LGTM!

Switching to tsx for the dev script modernizes the TypeScript execution workflow.


8-16: LGTM!

Dependency updates are consistent with the Prisma 6.18+ upgrade and generated client pattern. The addition of dotenv and tsx tooling aligns with modern best practices.

orm/testing-express/package.json (4)

5-5: LGTM!

Adding "type": "module" correctly enables native ES module support for this package.


7-8: LGTM!

The dev script migration to tsx and the test script update with NODE_OPTIONS=--experimental-vm-modules properly enable ESM support for Jest testing.


15-20: LGTM!

Dependencies correctly updated to Prisma 6.18+ with adapter and accelerate extension support, plus dotenv for environment configuration.


37-37: LGTM!

The Prisma seed script correctly updated to use tsx instead of ts-node.

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: 1

📜 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 e4cfb04 and 1e0b6f5.

📒 Files selected for processing (1)
  • orm/postgis-express/prisma/test-environment.js (1 hunks)
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
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: 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: 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-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.
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.
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.
📚 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/postgis-express/prisma/test-environment.js
📚 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/postgis-express/prisma/test-environment.js
📚 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/postgis-express/prisma/test-environment.js
📚 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/postgis-express/prisma/test-environment.js
📚 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/postgis-express/prisma/test-environment.js
📚 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/postgis-express/prisma/test-environment.js
⏰ 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). (22)
  • GitHub Check: test (orm/clerk-nextjs)
  • GitHub Check: test (orm/astro)
  • GitHub Check: test (orm/betterauth-astro)
  • GitHub Check: test (orm/nest)
  • GitHub Check: test (orm/ai-sdk-nextjs)
  • GitHub Check: test (orm/betterauth-nextjs)
  • GitHub Check: test (orm/grpc)
  • GitHub Check: test (orm/graphql-sdl-first)
  • GitHub Check: test (orm/nest-graphql)
  • GitHub Check: test (orm/authjs-nextjs)
  • GitHub Check: test (orm/koa)
  • GitHub Check: test (orm/nest-graphql-sdl-first)
  • GitHub Check: test (orm/fastify-graphql-sdl-first)
  • GitHub Check: test (orm/hapi-graphql)
  • GitHub Check: test (orm/hapi-graphql-sdl-first)
  • GitHub Check: test (orm/graphql-nexus)
  • GitHub Check: test (orm/nextjs)
  • GitHub Check: test (orm/nuxt)
  • GitHub Check: test (orm/nextjs-trpc)
  • GitHub Check: test (orm/nextjs-graphql)
  • GitHub Check: test (orm/react-router-7)
  • GitHub Check: test (orm/solid-start)

@AmanVarshney01 AmanVarshney01 merged commit e20aaa3 into latest Nov 2, 2025
47 checks passed
@AmanVarshney01 AmanVarshney01 deleted the Update-misc-examples branch November 2, 2025 14:39
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