Skip to content

Inspection functions in the TSID DuckDB extension

Function category

Inspection

1 function

Extract the timestamp embedded in a TSID. Lets you recover insertion time without storing a separate timestamp column.

tsid_to_timestamp

Scalar function Inspection
Signature
tsid_to_timestamp(tsid: VARCHAR) TIMESTAMP
Arguments (Positional)
Argument tsid Type VARCHAR Mode Positional Description
Description
1 Recover when a row was inserted from its id alone
SELECT id, tsid_to_timestamp(id) AS created_at FROM events;