v8.0.0-rc.1
Breaking Changes📦 prismaView on GitHub →
⚠ 2 breaking✨ 1 features🐛 4 fixes🔧 5 symbols
Summary
This release introduces the v8 release-candidate line, versioned as `8.0.0-rc.N`, and changes how aggregate results are read back through codecs, impacting types like `count()` which now returns `bigint`. It also splits the SQL driver interface and fixes several defects in query planning, emit, and driver error reporting.
⚠️ Breaking Changes
- Aggregate results now carry the codec their target declares. This means aggregate application types have changed. For example, `count()` now returns a `bigint` on PostgreSQL and SQLite. Equality checks and arithmetic operations against aggregate results may need to be updated (e.g., `count === 2` should become `count === 2n`). Stringifying bigint values will throw an error. Regenerate your contracts using `prisma-next contract emit` as `contract.d.ts` will gain an `AggregateTypes` block. If you are implementing or wrapping `SqlQueryable`, update your implementation to the new two-method shape: `query()` for streaming rows and `execute()` for statement statistics. The separate prepared-execution method is removed; prepared plans are now expressed by an optional `preparedStatementHandle` on the request.
- The SQL driver interface has been split into two methods: `query()` for row streaming and `execute()` for statistics. The `executePrepared` method is removed. If you implement or wrap `SqlQueryable`, you need to update your implementation to this new shape.
Migration Steps
- Regenerate your contracts using `prisma-next contract emit`.
- Update any custom implementations or wrappers of `SqlQueryable` to the new two-method interface (`query()` and `execute()`).
- Sweep your code for equality and arithmetic operations against aggregate results and update them to handle `bigint` types (e.g., change `count === 2` to `count === 2n`).
- Be aware that `stringify` over a bigint will throw an error.
✨ New Features
- `prisma-next init` now installs a single `prisma-8` skill instead of multiple per-workflow skills, and cleans up retired skill directories. Skills are now installed by name (`prisma-8`, `prisma-next-upgrade`, `prisma-8-extension-upgrade`), preventing accidental inclusion of new skills.
🐛 Bug Fixes
- Columns, tables, or models mapped to names that are not bare TypeScript identifiers (e.g., `@map("has space")`) now correctly emit quoted property keys in `contract.d.ts`, preventing syntactically invalid files. String literals in emitted TypeScript now correctly handle control characters and line separators.
- Nested `some`/`every`/`none` predicates over self-referential relations now maintain distinct SQL aliases at every level, resolving issues where inner scopes shadowed parent correlations. This fix applies to various relation types and across namespaces.
- Scalar reducers (`count()`, `sum()`, `avg()`, `min()`, `max()`) on many-to-many includes now correctly traverse the junction table, ensuring accurate filtered relation counts.
- Failed retries of stale PostgreSQL prepared statements now surface a structured error envelope with the code `DRIVER.PREPARE_FAILED`, including the normalized driver error as the cause, instead of an unlabelled failure.