Skip to content

5.18.0

Choose a tag to compare

@jharrell jharrell released this 06 Aug 16:07
· 8186 commits to main since this release
717026b

馃専 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鈥檝e 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鈥檝e 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)

Share your feedback about Prisma ORM

We want to know how you like working with Prisma ORM in your projects! Please take our 2min survey and let us know what you like or where we can improve 馃檹

Credits

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