Prisma: 5.11.0 Release

Release date:
March 11, 2024
Previous version:
5.10.2 (released February 21, 2024)
Magnitude:
2,368 Diff Delta
Contributors:
7 total committers
Data confidence:
Commits:

68 Commits in this Release

Ordered by the degree to which they evolved the repo in this version.

Authored March 5, 2024
Authored February 26, 2024
Authored February 27, 2024
Authored March 4, 2024
Authored March 4, 2024

Top Contributors in 5.11.0

millsp
Druue
Jolg42
jkomyno
SevInf
prisma-bot
renovate-bot

Directory Browser for 5.11.0

All files are compared to previous version, 5.10.2. Click here to browse diffs between other versions.

Loading File Browser...

Release Notes Published

Today, we are excited to share the 5.11.0 stable release 🎉

🌟 Help us spread the word about Prisma by starring the repo ☝️ or posting on X about the release.

Highlights

Edge function support for Cloudflare and Vercel (Preview)

We’re thrilled to announce that support for edge function deployments with Prisma ORM is now in Preview 🥳 As of this release, you can deploy your apps that are using Prisma ORM to:

  • Vercel Edge Functions and Vercel Edge Middleware
  • Cloudflare Workers and Cloudflare Pages

In order to deploy to an edge function, you’ll need to use a compatible database driver (along with its Prisma driver adapter):

  • Neon Serverless Driver (for PostgreSQL databases hosted via Neon)
  • PlanetScale Serverless Driver (for MySQL databases hosted via PlanetScale)
  • pg driver (for traditional PostgreSQL databases)
  • @libsql/client driver (for SQLite databases hosted via Turso)

Check out our documentation to learn how you can deploy an edge function using any combination of supported edge function provider and database.

You can also read more about it in the announcement blog post!

Performance improvements in nested create operations

With Prisma ORM, you can create multiple new records in nested queries, for example:

const user = await prisma.user.update({
  where: { id: 9 },
  data: {
    name: 'Elliott',
    posts: {
      create: {
        data: [{ title: 'My first post' }, { title: 'My second post' }],
      },
    },
  },
})

In previous versions, Prisma ORM would translate this into multiple SQL INSERT queries, each requiring its own roundtrip to the database. As of this release, these nested create queries are optimized and the INSERT queries are sent to the database in bulk in a single roundtrip. These optimizations apply to one-to-many as well as many-to-many relations.

With this change, using the nested create option to create multiple records effectively becomes equivalent to using a nested createMany operation (except that createMany only works with one-to-many relations, whereas create works both with one-to-many and many-to-many).

Note: Only the deepest nested operation is optimized. If a user specified create (1) -> create (2) -> create (3) in their query, only create (3) will be optimized.

Fixes and improvements

Prisma Client

Prisma Migrate

Prisma Engines