Skip to content

Conversation

omar-dulaimi
Copy link
Contributor

@omar-dulaimi omar-dulaimi commented Sep 4, 2025

What’s in this PR

Updates the orm/typedsql example to the latest stable Prisma release to fix a TypeScript break caused by recent changes in Prisma’s config types.

Changes

  • @prisma/client: 6.9.0 ➜ 6.15.0
  • prisma: 6.9.0 ➜ 6.15.0
  • @types/node: 22.15.32 ➜ ^24.3.0
  • tsx: 4.20.3 ➜ 4.20.5
  • Add dotenv to dev dependencies to make local env loading explicit

Only orm/typedsql/package.json is touched. No source changes.

Why

Recent Prisma releases introduced updates around configuration typing, which caused the typedsql example to fail type-checking when following latest Prisma docs. Moving to 6.15.0 aligns the example with the current stable.

TypedSQL docs for reference: https://www.prisma.io/docs/orm/reference/prisma-config-reference

Notes

  • Keeps the example on the latest stable Prisma to reduce churn for new users trying TypedSQL.
  • No behavioral changes expected; dependency maintenance only.

Summary by CodeRabbit

  • Chores
    • Updated underlying dependencies to the latest stable releases to improve compatibility, security patches, and overall reliability.
    • Added environment variable tooling to streamline local development and configuration.
    • Improves build consistency and reduces setup friction for contributors.
    • No user-facing changes or behavior modifications in this release.

Copy link

coderabbitai bot commented Sep 4, 2025

Walkthrough

Dependency updates in orm/typedsql/package.json: bumps @prisma/client, prisma, @types/node, and tsx versions, and adds dotenv as a new devDependency. No source files or runtime code changes are included.

Changes

Cohort / File(s) Summary
Dependency updates
orm/typedsql/package.json
Updated: @prisma/client 6.9.0 → 6.15.0, prisma 6.9.0 → 6.15.0, @types/node 22.15.32 → ^24.3.0, tsx 4.20.3 → 4.20.5; Added devDependency: dotenv ^17.2.2
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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

Caution

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

⚠️ Outside diff range comments (1)
orm/typedsql/package.json (1)

6-8: Confirm that package.json["prisma"].seed remains your intended mechanism.

It’s still supported, but many projects now prefer explicit npm run db:seed scripts for clarity. Optional, not blocking.

Example (outside changed lines):

{
  "scripts": {
    "db:seed": "dotenv -e .env -- tsx prisma/seed.ts"
  }
}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4b0ec2b and e0f5e42.

📒 Files selected for processing (1)
  • orm/typedsql/package.json (1 hunks)
🧰 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/typedsql/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). (24)
  • GitHub Check: test (orm/ai-sdk-nextjs)
  • GitHub Check: test (orm/astro)
  • GitHub Check: test (orm/graphql-sdl-first)
  • GitHub Check: test (orm/koa)
  • GitHub Check: test (orm/express)
  • GitHub Check: test (orm/fastify-graphql-sdl-first)
  • GitHub Check: test (orm/clerk-nextjs)
  • GitHub Check: test (orm/graphql)
  • GitHub Check: test (orm/fastify)
  • GitHub Check: test (orm/authjs-nextjs)
  • GitHub Check: test (orm/betterauth-nextjs)
  • GitHub Check: test (orm/hapi-graphql-sdl-first)
  • GitHub Check: test (orm/nest-graphql-sdl-first)
  • GitHub Check: test (orm/nest-graphql)
  • GitHub Check: test (orm/nuxt)
  • GitHub Check: test (orm/nest)
  • GitHub Check: test (orm/fastify-graphql)
  • GitHub Check: test (orm/graphql-nexus)
  • GitHub Check: test (orm/grpc)
  • GitHub Check: test (orm/hapi-graphql)
  • GitHub Check: test (orm/nextjs-graphql)
  • GitHub Check: test (orm/nextjs)
  • GitHub Check: test (orm/solid-start)
  • GitHub Check: test (orm/sveltekit)
🔇 Additional comments (1)
orm/typedsql/package.json (1)

25-25: tsx patch bump is safe.

No breaking changes expected; just ensure CI cache is invalidated so new binaries install cleanly.

@@ -16,11 +16,12 @@
"author": "",
"license": "ISC",
"dependencies": {
"@prisma/client": "6.9.0"
"@prisma/client": "6.15.0"
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Prisma Client bump to 6.15.0 looks good; ensure regeneration happens.

This aligns the example with current Prisma. Make sure @prisma/client postinstall runs or that CI executes prisma generate so TS types reflect 6.15.0.

Run:


🏁 Script executed:

#!/bin/bash
# Verify versions and that client is generated
jq -r '.dependencies["@prisma/client"]' orm/typedsql/package.json
jq -r '.devDependencies.prisma' orm/typedsql/package.json
rg -nP '(?i)prisma.*generate' -n -C2 orm/typedsql

Length of output: 1499


Ensure Prisma Client is regenerated after the version bump
Add a postinstall script in orm/typedsql/package.json (or ensure your CI runs npx prisma generate) so that TypeScript types are updated to 6.15.0, for example:

"scripts": {
  "postinstall": "prisma generate"
}
🤖 Prompt for AI Agents
In orm/typedsql/package.json around line 19, after bumping "@prisma/client" to
6.15.0 the Prisma Client must be regenerated; add a postinstall script to
package.json that runs the Prisma generator (e.g., "postinstall": "prisma
generate") or ensure your CI installs runs npx prisma generate, then run the
generate step locally (or in CI) so TypeScript types are updated to the new
Prisma version.

Comment on lines +22 to +25
"@types/node": "^24.3.0",
"dotenv": "^17.2.2",
"prisma": "6.15.0",
"tsx": "4.20.5"
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Dev deps bumps look fine; declare supported Node version to prevent type/runtime drift.

@types/node ^24 can expose newer APIs at type level; add an explicit engines constraint to document/support the intended Node runtime for this example.

Proposed addition (outside changed lines):

{
  "engines": { "node": ">=18.18 <=26" }
}

Adjust the range to your CI/runtime.

🤖 Prompt for AI Agents
In orm/typedsql/package.json around lines 22 to 25, add an "engines" field to
declare the supported Node runtime to avoid type/runtime drift from bumping
@types/node; insert an "engines": { "node": ">=18.18 <=26" } (or adjust the
range to match your CI/runtime) at the top-level of package.json so package
managers and CI enforce the intended Node version.

"prisma": "6.9.0",
"tsx": "4.20.3"
"@types/node": "^24.3.0",
"dotenv": "^17.2.2",
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

dotenv is added but not wired; ensure .env loading is actually invoked.

Right now scripts won’t load .env unless app code imports dotenv/config. Either import it in src/index.ts and prisma/seed.ts, or wrap scripts with the dotenv CLI.

If you prefer script-based loading (recommended for examples), update scripts (outside changed lines) like:

{
  "prisma": { "seed": "dotenv -e .env -- tsx prisma/seed.ts" },
  "scripts": {
    "start": "dotenv -e .env -- tsx src/index.ts",
    "dev": "dotenv -e .env -- tsx src/index.ts --watch",
    "test": "dotenv -e .env -- tsx src/index.ts",
    "debug": "dotenv -e .env -- tsx src/index.ts"
  }
}

Or add at the top of both entrypoints:

import 'dotenv/config'

Verification script:


🏁 Script executed:

#!/bin/bash
# Check if dotenv is imported or used via CLI
rg -nP 'dotenv/(config| -e )' -C2 orm/typedsql || true

Length of output: 55


🏁 Script executed:

#!/bin/bash
# Show the top of package.json to inspect scripts and dependencies
sed -n '1,200p' orm/typedsql/package.json

# Search for dotenv imports in TypeScript files
rg -nP "import\s+['\"]dotenv/config['\"]" -C2 orm/typedsql

# Search for dotenv requires in CommonJS-style files
rg -nP "require\(['\"]dotenv/config['\"]\)" -C2 orm/typedsql

# Broad search for any dotenv usage
rg -n 'dotenv' -C2 orm/typedsql

Length of output: 1039


Wire dotenv initialization
dotenv is installed but never invoked, so environment variables won’t load at runtime. You must either:

  • Add at the top of both entrypoints (src/index.ts and prisma/seed.ts):
    import 'dotenv/config'
  • Or update your package.json scripts to wrap with the dotenv CLI, for example:
    "prisma": {
      "seed": "dotenv -e .env -- tsx prisma/seed.ts"
    },
    "scripts": {
      "start": "dotenv -e .env -- tsx src/index.ts",
      "dev":   "dotenv -e .env -- tsx src/index.ts --watch",
      "test":  "dotenv -e .env -- tsx src/index.ts",
      "debug": "dotenv -e .env -- tsx src/index.ts"
    }
🤖 Prompt for AI Agents
In orm/typedsql/package.json around line 23, dotenv is listed as a dependency
but never initialized, so environment variables won’t be loaded; fix by either
importing dotenv/config at the top of both entrypoints (src/index.ts and
prisma/seed.ts) or by updating package.json scripts to run the entrypoints via
the dotenv CLI (wrap the start/dev/test/debug and prisma.seed commands with
dotenv -e .env --) so the .env file is loaded before execution.

"tsx": "4.20.3"
"@types/node": "^24.3.0",
"dotenv": "^17.2.2",
"prisma": "6.15.0",
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Prisma CLI 6.15.0 bump is consistent; validate config typing is resolved.

Since this PR targets a TypedSQL config type break, confirm prisma.config.ts (if present) type-checks and that prisma db seed still picks up your seed script.

Run:

If prisma.config.ts exists, ensure it imports from @prisma/config per 6.x typings.


🏁 Script executed:

#!/bin/bash
# Locate prisma.config and seed file
fd -a 'prisma.config.*' orm/typedsql || true
fd -a 'seed.ts' orm/typedsql || true

# Type-check if a tsconfig exists for the example
fd -a 'tsconfig*.json' orm/typedsql || true

Length of output: 152


Add Prisma TS config and tsconfig.json for TypeScript seed
No prisma.config.ts or tsconfig.json is present, so prisma db seed won’t load the prisma/seed.ts script. Create a prisma.config.ts (importing from @prisma/config per 6.x typings) alongside a tsconfig.json to enable runtime compilation of your TypeScript seed.

🤖 Prompt for AI Agents
In orm/typedsql/package.json around line 24, the project pins Prisma 6.15.0 but
lacks the runtime TypeScript seed configuration; add a new prisma.config.ts file
in the prisma/ directory that imports the proper helper from @prisma/config and
exports the configuration so prisma db seed can load prisma/seed.ts, and also
add a project-level tsconfig.json (or prisma/tsconfig.json) enabling compilation
for runtime seeds (target ES2020/ESNext, module ESNext or CommonJS to match your
build, allowJs false, resolveJsonModule true, esModuleInterop true, skipLibCheck
true, and include "prisma" and "prisma/seed.ts") so Prisma will compile and run
the TypeScript seed script when running prisma db seed.

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.

1 participant