Skip to content

Conversation

@epiben
Copy link

@epiben epiben commented Nov 3, 2025

Description

With this PR, users can choose between UUIDv4 and UUIDv7 for their PKs.

Related Issue

This PR implements the request made in #1532.

Motivation and Context

Using UUIDv7 yields faster I/O because they're sortable and, thus, friendlier to database indices. Being sortable, it's also possible to show the chronological order of historical records when these are created with below-minute resolution (the lowest allowed by history_date) or when multiple records are set to have the same history_date but with a meaningful order of insertion.

The implementation is non-breaking in that it adds a new settings for specifying the UUID version, falling back to UUIDv4 (the currently only option) if unspecified.

How Has This Been Tested?

With the full test suite. The MySQL tests couldn't even run on my machine, so I'd be happy for some help to make that work locally if required.

Screenshots (if appropriate):

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have run the pre-commit run command to format and lint.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have added my name and/or github handle to AUTHORS.rst
  • I have added my change to CHANGES.rst
  • All new and existing tests passed.

epiben added 7 commits October 2, 2025 13:45
Signed-off-by: Benjamin Skov Kaas-Hansen <[email protected]>
Signed-off-by: Benjamin Skov Kaas-Hansen <[email protected]>
Signed-off-by: Benjamin Skov Kaas-Hansen <[email protected]>
Signed-off-by: Benjamin Skov Kaas-Hansen <[email protected]>
Signed-off-by: Benjamin Skov Kaas-Hansen <[email protected]>
Signed-off-by: Benjamin Skov Kaas-Hansen <[email protected]>
@epiben epiben changed the title WIP: Enable UUIDv7 Enable UUIDv7 Nov 3, 2025
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.

1 participant