🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
Introspection warnings for unsupported features
The Prisma Schema Language (PSL) currently doesn't support all database features and functionality of our target databases. The PSL is an abstraction over SQL and will keep evolving to address gaps in our database feature matrix.
Before this release, prisma db pull
did not pick up the unsupported features in a database. It was easy to lose them when running prisma migrate dev
based on an existing Prisma schema if not included in a migration file using custom migrations.
To avoid this, we added introspection warnings that surface the existence of these features in your database and link to our documentation on how to manually work around the Prisma Schema with unsupported database features.
In this release, we added introspection warnings for the following features:
- Partitioned tables
- PostgreSQL Row Level Security
- Index sort order,
NULLS FIRST
/NULLS LAST
- CockroachDB row-level TTL
- Comments
- PostgreSQL deferred constraints
Prisma CLI will output warnings on introspection (prisma db pull
) and add comments to your Prisma schema. In the coming releases, we will expand this to many more features labeled with topic: database-functionality
on GitHub.
Improved support for Netlify and Vercel build process
Netlify and Vercel cache project dependencies during the build process and reuse that cache until dependencies change. While this helps speed up the build process, any postinstall
scripts of these dependencies will not be executed.
Prisma uses a postinstall
script in its package to automatically trigger the customized generation of Prisma Client for your Prisma Schema. When a dependency cache is used, that generation process is not triggered, and an outdated Prisma Client may be used in your application.
When you update your Prisma Schema but not your dependencies, Prisma Client will not be generated for the new schema. For example, columns you added recently to one of your models will not be present in the Prisma Client API - causing errors.
This problem can be avoided by:
- Adding a custom
postinstall
script in yourpackage.json
file - Manually adding a
prisma generate
step to the “Build” scripts of Vercel and Netlify.
We now added detection of this scenario and will prevent a build without an additional prisma generate
. This will ensure you're aware of the problem early and get guidance on how to fix this problem. You can read more on how to do this in our docs — Vercel caching troubleshooting, Netlify caching troubleshooting.
Better support for pnpm as a package manager
Before this release, Prisma only used npm scripts which would lead to undesirable behavior for a project using a different package manager such as pnpm and yarn. This release improves the detection of the package managers in your project by using ni
. If you're still running into this problem, let us know by creating a GitHub issue.
Segmentation fault and TLS connection error fix
In this release, we've fixed a TLS connection error segmentation fault. This mostly affected users running on Node.js 17 or later with OpenSSL 1.1 when using TLS to connect to their database.
JSON protocol Preview feature feedback
We have fixed multiple bugs for the jsonProtocol
Preview feature and are close to making it Generally Available. We are still looking for feedback about its usage to ensure it is ready and works as expected for everyone.
We would appreciate it if you would try it out, help us polish the feature, and move it to General Availability. Testing it requires little effort. You can test it using the following steps:
- Enabling the
jsonProtocol
Preview feature in your Prisma schema - Re-generating Prisma Client
- Running your application or tests to make sure everything works
We encourage you to leave your feedback in this GitHub issue or create a bug report if your run into any issues.
Fixes and improvements
Prisma Client
prisma generate
fails when using pnpm workspaces because it tries to install prisma dependencies with npm or yarn- Netlify deploy does not pick up changes to schema file
- Vercel: Schema only change does not invalidate build cache
- Serverless deployments: Just making a schema level change to a repository does not invalidate
node_modules
cache that contains generated Client - pnpm: Can not
prisma generate
when@prisma/client
is not installed in project - Segmentation fault crash when using prisma client when using PostgreSQL
- Docker with
pnpm install
hangs on@prisma/client
postinstall - Automatic installation of missing dependencies isn't compatible with pnpm
- Prisma generate throws dependency error karma-chai
- Postinstall script fails with PNPM workspaces due to npm ERR! Cannot read properties of null (reading 'matches')
- Debian 11 Node 19.3.0 segmentation fault
- Prisma client segfault on Ubuntu 22.04
- Segmentation Fault in Postgres
- Using Prisma with pnpm results in inability to call database related commands
- Prisma Connect Causes NodeJS to Close With Exit Code 0
- 99056 segmentation fault (core dumped) node --require esbuild-register prisma/seed.ts
- JSON protocol: sibling composites of the same type are rejected
Prisma Migrate
- prisma db pull adds redundant comments: "This table is a partition table ..."
- Render warning code 30 in cli (PG RLS)
Language tools (e.g. VS Code)
Credits
Huge thanks to @KhooHaoYit, @rintaun, @maxmartynov, @haneenmahd for helping!
📺 Join us for another "What's new in Prisma" live stream
Learn about the latest release and other news from the Prisma community by joining us for another "What's new in Prisma" live stream.
The stream takes place on YouTube on Thursday, April 20 at 5 pm Berlin | 8 am San Francisco.