Support UUID v7 #24079
Labels
kind/feature
A request for a new feature.
team/client
Issue for team Client.
team/schema
Issue for team Schema.
topic: uuid
Problem
Efficient cursor-based pagination relies on lexicographical and chronological sorting support, which is not provided by older UUID versions.
Suggested solution
UUID v7 fills a big gap in the database space by addressing the need for the lexicographically and chronologically sortable identifiers. CUID and ULID are strong contenders, but they come with a significant adoption friction involved, due to not being UUID-compatible, and hence not qualifying as a drop-in replacement. Also Prisma currently doesn't support ULID at all, and for CUID only deprecated version 1 is supported.
Implementing UUID v7 support on Prisma level would have a huge impact for addressing this need and enabling the adoption of the new standard. Since it is storage-compatible with UUID v4, it could already be adopted in existing databases with very little changes.
UUID v7 was already published as an RFC, see https://www.rfc-editor.org/info/rfc9562, so it should be safe to implement it already.
There is an existing Rust implementation: https://crates.io/crates/uuid7 - it implements the published RFC, and can be used to provide support.
Usage syntax could be identical to the existing CUID support:
Alternatives
Additional context
The text was updated successfully, but these errors were encountered: