Change8

7.1.0

📦 prismaView on GitHub →
6 features🐛 2 fixes🔧 9 symbols

Summary

Prisma 7.1.0 introduces SQL Commenter support for enhanced query observability and tracing, alongside TypeScript improvements for pnpm monorepos and the env() helper.

Migration Steps

  1. If using the read-replicas extension, upgrade to @prisma/extension-read-replicas@latest for Prisma 7 compatibility.
  2. To use SQL comments, install @prisma/sqlcommenter-query-tags or @prisma/sqlcommenter-trace-context and add them to the 'comments' array in the PrismaClient constructor.

✨ New Features

  • Introduced SQL Commenter support to append metadata (sqlcommenter format) to SQL queries for better observability.
  • Added @prisma/sqlcommenter-query-tags package for adding arbitrary tags to queries via async context.
  • Added @prisma/sqlcommenter-trace-context package to include W3C Trace Context (traceparent) in SQL comments.
  • Support for custom SQL Commenter plugins via the SqlCommenterPlugin type.
  • The env() helper now accepts interface-based generics, resolving TS2344 errors.
  • Added a descriptive error message when attempting to instantiate PrismaClient without configurations.

🐛 Bug Fixes

  • Resolved TypeScript issues in pnpm monorepos related to @prisma/client-runtime-utils.
  • Marked @opentelemetry/api as an external dependency in instrumentation to prevent duplicate package bundling.

🔧 Affected Symbols

PrismaClientenv@prisma/client-runtime-utils@opentelemetry/apiSqlCommenterPluginqueryTagstraceContextwithQueryTagswithMergedQueryTags