Skip to content

Allow specifying UUIDv7/UUIDv8 datetime range #566

@fwdekker

Description

@fwdekker

When generating a UUIDv7 or UUIDv8, users may have certain constraints on what datetimes are valid. For example, perhaps only UUIDs between 2020 and 2030 are considered valid for the application. For this reason, it should be possible to specify a datetime range when generating a UUIDv7 or UUIDv8.

I also think it would be useful to have an option where either the minimum datetime or the maximum datetime is set to "right now". When set to "right now", the generator checks at the moment that the value is inserted what datetime it is then, and uses that value. This way, users can generate UUIDs that are guaranteed to refer to the past or to the future, relative to the moment at which the value is generated.

Setting both minimum and maximum to "right now" means that the generated value always refers to the moment at which the value is inserted.

This issue was originally requested by email by Czajka667.

Metadata

Metadata

Assignees

Labels

featureNew feature or request

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions