v.25.8New Feature

Add function dateTimeToUUIDv7 to convert a DateTime

Added function dateTimeToUUIDv7 to convert a DateTime value to a UUIDv7. Example usage: SELECT dateTimeToUUIDv7(toDateTime('2025-08-15 18:57:56')) returns 0198af18-8320-7a7d-abd3-358db23b9d5c. #84319 (samradovich).
Added the dateTimeToUUIDv7 function to convert DateTime values into UUID version 7 format.

Why it matters

This feature allows users to generate UUIDv7 identifiers based on DateTime 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 a DateTime 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.