What is the best way to use UUID v7 in postgres with Prisma?

Also is there a way to add PL/pgSql using Prisma schema?
4 Replies
Prisma AI Help
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into #ask-ai for a quick spin!
Nurul
Nurul3w ago
You can use UUID v7 like this:
model User {
id String @id @default(uuid(7)) @db.Uuid
name String
}
model User {
id String @id @default(uuid(7)) @db.Uuid
name String
}
Inverse
Inverse2w ago
Why not just use the cuid() function to provide collision resistant UUIDs? Just a thought...

Did you find this page helpful?