We just released Prisma ORM 7.2.0, which includes several bug fixes and improvements. We’ve also been reviewing community feedback on Prisma 7 and making adjustments to better support your needs.
Upgrading to 7.2
To upgrade to the latest release, install the appropriate packages using the @latest tag:
Bringing back the --url flag to Prisma CLI
In v7, we removed the --url flag from various prisma db subcommands. This flag was mostly undocumented, and we didn’t think many people were using it. However, community feedback showed that this flag was extremely useful. As a result, we’ve brought it back in v7.2.0 and made updates to support the new Prisma config setup.
Now whenever you run the following commands:
prisma db pullprisma db pushprisma migrate dev
If you pass a --url pointing to your datasource, the Prisma CLI will use it instead of what’s defined in your prisma.config.ts.
Customized prisma init output based on JS runtime
As part of the move to a Prisma config file, running prisma init would generate a default config file with the following output:
This works most of the time, but it makes some assumptions that aren’t always valid. For instance, we explicitly import dotenv here, which is only needed in Node and not required in Bun. To address this, we’ve added runtime-specific config output based on the JavaScript environment.
If prisma init is run in Bun, it will generate the following:
For Node environments (npx, pnpm, bunx, bun run):
Here, we still need dotenv and can remove the need to use the env helper function.
Optional URL for prisma generate and better error messages
Additionally, we’ve reworked how the Prisma CLI behaves when your Prisma config has an undefined URL. With 7.2.0, prisma generate can now be run even if you don’t set an environment variable for your database URL.
We also improved error messages when you choose to use the env helper function. If you try to run prisma generate while using the helper function to enforce variables being set, you’ll see the following error:
As a bonus, if you try to run prisma db ... without a valid URL, you’ll now get a clearer error message:
[DecimalError] Invalid argument when using the @db.Money type
If you’ve been using the @db.Money type in your Prisma schema, you might have run into an issue where values over 999.99 would throw an error like [DecimalError] Invalid argument: X,XXX. Parsing money values from Postgres is complicated due to locale differences and the wide range of accepted formats.
This issue was reported back in July, and we’re thrilled that it’s been fixed in 7.2.0.
Parting Thoughts
As we mentioned in a previous post, we’re aware of a performance regression that appears in some specific cases. We’re actively working on a fix and plan to release it as soon as possible. We’ll share more updates once the fix has been merged and released.
Be sure to follow us on social media to stay up to date with the latest releases of Prisma ORM and Prisma Postgres:
Don’t miss the next post!
Sign up for the Prisma Newsletter