npm prisma 5.18.0

latest releases: 5.23.0-dev.7, 5.23.0-dev.6, 5.23.0-dev.5...
3 months ago

🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟

Highlights

Native support for UUIDv7

Previous to this release, the Prisma Schema function uuid() did not accept any arguments and created a UUIDv4 ID. While sufficient in many cases, UUIDv4 has a few drawbacks, namely that it is not temporally sortable.

UUIDv7 attempts to resolve this issue, making it easy to temporally sort your database rows by ID!

To support this, we’ve updated the uuid() function in Prisma Schema to accept an optional, integer argument. Right now, the only valid values are 4 and 7, with 4 being the default.

model User {
  id   String @id @default(uuid()) // defaults to 4
  name String
}

model User {
  id   String @id @default(uuid(4)) // same as above, but explicit
  name String
}

model User {
  id   String @id @default(uuid(7)) // will use UUIDv7 instead of UUIDv4
  name String
}

Bug squashing

We’ve squashed a number of bugs this release, special thanks to everyone who helped us! A few select highlights are:

Fixes and improvements

Prisma

Language tools (e.g. VS Code)

Credits

Huge thanks to @mcuelenaere, @pagewang0, @Druue, @key-moon, @Jolg42, @pranayat, @ospfranco, @yubrot, @skyzh, @haaawk for helping!

Don't miss a new prisma release

NewReleases is sending notifications on new releases.