Skip to content

Simplify UUIDv7 options#4721

Merged
josevalim merged 1 commit intoelixir-ecto:masterfrom
ryanwinchester:uuid-opinions
Apr 26, 2026
Merged

Simplify UUIDv7 options#4721
josevalim merged 1 commit intoelixir-ecto:masterfrom
ryanwinchester:uuid-opinions

Conversation

@ryanwinchester
Copy link
Copy Markdown
Contributor

@ryanwinchester ryanwinchester commented Apr 26, 2026

Simplify the UUIDv7 options and make them more opinionated and easier to use.

  • Too much flexibility means too easy to use in a weird way.
  • There isn't really a good reason to use monotonic in combination with milliseconds.
  • Nanoseconds wasn't really nanoseconds, but sub-milliseconds based on nanoseconds, stepped across 12 bits

Since there hasn't been a release yet since the UUIDv7 options were added, it's a good time to do this.

Before

Options:

  • precision: :millisecond | :nanosecond
  • monotonic: true | false

After

Options:

  • precision: :millisecond | :monotonic

@josevalim josevalim merged commit 9fee945 into elixir-ecto:master Apr 26, 2026
8 checks passed
@josevalim
Copy link
Copy Markdown
Member

Love it! 💚 💙 💜 💛 ❤️

@ryanwinchester ryanwinchester deleted the uuid-opinions branch April 26, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants