Hacker News new | ask | show | jobs
by dchuk 1248 days ago
Is there any way to have the database generate these automatically vs your application?
2 comments

The common databases don't support natively support generating ULIDs to my knowledge. You can usually find extensions if you prefer generating them in the database instead of the application. I generate them in the application, and store them as a UUID in PostgreSQL to avoid needing any database extensions.
Yea, there are a few extensions for PG, in C and Go that give a ulid_create() function that can be used as column default, just like serial.