Generation functions in the TSID DuckDB extension
Function category
Generation
1 functionMint a new TSID. Calling `tsid()` repeatedly produces strictly increasing values (by string compare) suitable as primary keys.
Signature
tsid() → VARCHAR
Description
Generate a new Time-Sorted Unique Identifier — a 32-character hex string. Optional seed string makes IDs from the same seed reproducible-ordered. Calls within the same microsecond stay distinct.
1
One-off ID
SELECT tsid();
2
Bulk generation with random seed
SELECT tsid() AS id FROM range(100);