@prisma/sdk
4.0.0 · 28 Jun 2022Apache-2.040.1k / weekRepositoryHomepagenpmAtom feed
2.30.3 is the newest release of 2.x.
In short
41 new1 fixed3 changed
Security
1 advisory affects 2.19.0; 2.20.0 fixes them
- HighCommand injection vulnerability in @prisma/sdk in getPackedPackage functionGHSA-pxcc-hj8w-fmm7 · 6 Apr 2021Fixed in 2.20.0
Release note
Today, we are excited to share the 2.19.0 stable release 🎉
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Major improvements & new features
Prisma Migrate is now ready for General Availability
We are excited to announce that Prisma Migrate enters General Availability. You can learn more about the launch in the announcement article.
There are no major changes to how Prisma Migrate works except that the --preview-feature flag is being removed:
Before v2.19.0
npx prisma migrate <COMMAND> --preview-feature # for example: npx prisma migrate dev --preview-feature
Now
npx prisma migrate <COMMAND> # for example: npx prisma migrate dev
Besides making Prisma Migrate ready for production in this release, it comes with a number of smaller fixes and improvements:
After
migrate dev,migrate resetanddb push, generation is always triggered to avoid issues where the Prisma Client API is outdated due to changes in relation names which have an impact on the database schema (GitHub issue)Improve UX when
migrate devproduces warnings (GitHub issue)Better error when adding a new required field and the default value is Prisma-level, e.g.
uuid()Small improvement where Prisma Migrate failed to create the database on DigitalOcean
Bugfix: Fix a bug when there are foreign keys referencing missing tables that resulted in a crash
Bugfix: Improvement when changing a field from type String to Enum (MySQL, PostgreSQL)
Bugfix: Improvement when migrating enums and a default enum value is defined (PostgreSQL)
📚 Documentation:
Order by aggregates of relations in Prisma Client queries (Preview)
This release makes it possible to order by the aggregates (e.g. count) of relations in your Prisma Client queries. Here's is an example that orders a list of users by the number of the posts they created:
const orderedUsers = await prisma.user.findMany({
orderBy: {
posts: {
count: 'asc'
}
}
})This feature is released in Preview which means you have to explicitly enable it via the orderByRelation feature flag in your Prisma schema:
generator client {
provider = "prisma-client-js"
previewFeatures = ["orderByRelation"]
}Don't forget to run npx prisma generate after you've added the feature flag to your Prisma schema so that the Prisma Client API gets updated accordingly.
Prisma Client Go now returns results from the Transaction API
Previously in the Go Client, you could write data within a transaction, but you couldn't get the results back from the transaction. Now you can! Learn more in the documentation.
Fixes and improvements
Prisma Client
when quering, passing string to DateTime field results runtime error
TypeError when using
npx prisma generatewith custom engine binaries
Prisma Migrate
Environment is “non-interactive” when using
prisma migrate devChange enum values when there is a default enum value fails migration
Prisma
migrate devprompts for migration name when running after --create-onlyUnformatted error message from
introspectwhen env var contains wrong connection string protocolSQL Server: recursive error message "Error querying the database"
Prisma migrate - always reporting Data loss / migration file changed even with simple field addition
Migration fails creating new database on Managed DO Postgres
Migrate does not recognize changes made to a field of type String to ENUM
Postgres Introspection occasionally removes "Unique" Constraint
Write test repro for "We assume an internally valid datamodel before mutating." from example schema
Can't convert
Stringfield toEnumin a migration - PostgresImprove readability of data loss warnings when running
migrate dev
Language tools (e.g. VS Code)
Prisma Studio
Learn about Enterprise use cases of Prisma on March 25th
We hope you join us for the upcoming Prisma Enterprise Event on Thursday, March 25th which is centered around the following topics:
Learn how top companies are addressing the challenges of data at scale
Discover how companies use Prisma to make their developers more productive
Get a better understanding of the future of data in the enterprise
Join us for another "What's new in Prisma" livestream
Learn about the latest release and other news from the Prisma community by joining us for another "What's new in Prisma" livestream.
The stream takes place on Youtube on Thursday, March 18 at 5pm Berlin | 8am San Francisco.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.