Closed t3hmrman closed 10 months ago
Implemented for cuid
(despite cuid
being deprecated in favor of cuid2
) in https://github.com/VADOSWARE/pg_idkit/commit/e10879b0cade592d8ad89fac709e0c07f049a978
UUID v7 handled in https://github.com/VADOSWARE/pg_idkit/pull/38
UUID v6 handled in https://github.com/VADOSWARE/pg_idkit/pull/37
PushID is not implemented, but as it depends on some upstream code (a branch makes with some WIP changes), I'm going to add a stretch goal to add support for it.
Context
Some UUIDs have time components embedded in them that can be extracted.
While not ever UUID generation mechanism can return a native type like
uuid
, it should be clear which type the function is returning.Proposal
Given a
text
value that has been generated bypg_idkit
with a function likeidkit_<mechanism>_generate
(or a similar function), there should be a functionidkit_<mechanism>_extract_timestamptz_from_<type>
For example:
text
withidkit_uuidv6_generate
idkit_uuidv6_extract_timestamptz_from_text
on the value to get atimestamptz
Alternatives
N/A
Additional Links
N/A