generate_uuidv7

utility

Generates UUID v7 (time-ordered UUID)

Syntax

generate_uuidv7()

Returns

string

A time-ordered UUID v7

Examples

Generate a UUID v7
Input:
generate_uuidv7()
Output:
"017f2239-0000-7000-8000-000000000000"
Add UUID v7 to each row
Input:
map({id: generate_uuidv7()})
Output:
[{id: "017f2239-0000-7000-8000-000000000000"}]

The generate_uuidv7() function generates a UUID version 7 identifier, which is time-ordered and sortable.

Usage

Use generate_uuidv7() when you need unique identifiers that are naturally sorted by creation time, making them ideal for database indexes and time-based queries.

Related Functions