Skip to content

Support ULID #13679

@p6l-richard

Description

@p6l-richard

Problem

UUID can be suboptimal for many use-cases because:

It isn't the most character efficient way of encoding 128 bits of randomness
UUID v1/v2 is impractical in many environments, as it requires access to a unique, stable MAC address
UUID v3/v5 requires a unique seed and produces randomly distributed IDs, which can cause fragmentation in many data structures
UUID v4 provides no other information than randomness which can cause fragmentation in many data structures

From the ULID spec.

The Lexicographically sortability would especially be useful for cursor-based pagination which requires sorting by a unique, sequential column.

Suggested solution

Support ULID in the prisma schema, by defining:
@db.Ulid

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions