Inspection functions in the TSID DuckDB extension
Function category
Inspection
1 functionExtract the timestamp embedded in a TSID. Lets you recover insertion time without storing a separate timestamp column.
Signature
tsid_to_timestamp(tsid: VARCHAR) → TIMESTAMP
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
tsid
|
Type
VARCHAR
|
Mode Positional | Description |
Description
Extract the embedded timestamp from a TSID. Returns TIMESTAMP — the time the ID was generated.
1
Recover when a row was inserted from its id alone
SELECT id, tsid_to_timestamp(id) AS created_at FROM events;