v.25.8New Feature
Add function dateTimeToUUIDv7 to convert a DateTime
Added functiondateTimeToUUIDv7to convert a DateTime value to a UUIDv7. Example usage:SELECT dateTimeToUUIDv7(toDateTime('2025-08-15 18:57:56'))returns0198af18-8320-7a7d-abd3-358db23b9d5c. #84319 (samradovich).
Why it matters
This feature allows users to generate UUIDv7 identifiers based onDateTime values, enabling time-ordered unique identifiers that can be useful for distributed systems and sorting by creation time.How to use it
Use the function by passing aDateTime expression to dateTimeToUUIDv7. For example:SELECT dateTimeToUUIDv7(toDateTime('2025-08-15 18:57:56'))This will return a UUIDv7 string corresponding to the provided
DateTime.