HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
jetify-com
typeid-sql
PLpgSQL2023–2023
jetify-com / typeid-sql

typeid-sql

SQL implementation TypeIDs: type-safe, K-sortable, and globally unique identifiers inspired by Stripe IDs

2Distinct people
2Mentions
0Explicit recommenders
118GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

SQL implementation TypeIDs: type-safe, K-sortable, and globally unique identifiers inspired by Stripe IDs

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 11:56:56 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by hour2 dated mentions

Observed mentions: 2023-06-28 17:42:25 UTC to 2023-06-28 19:48:11 UTC.

012023-06-28 17:00:00 UTC to 2023-06-28 18:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsJun 28, 17:002023-06-28 18:00:00 UTC to 2023-06-28 19:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsJun 28, 18:002023-06-28 19:00:00 UTC to 2023-06-28 20:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsJun 28, 19:00

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Jun 28, 17:002023-06-28 17:00:00 UTC2023-06-28 18:00:00 UTC101
Jun 28, 18:002023-06-28 18:00:00 UTC2023-06-28 19:00:00 UTC000
Jun 28, 19:002023-06-28 19:00:00 UTC2023-06-28 20:00:00 UTC101

What Hacker News says

2 sources
The authors have created a specialisation for Postgres that leverages a custom type which is a tuple of type and uuidv7: https://github.com/jetpack-io/typeid-sql/blob/main/sql/typei... This is more optimal for Postgres while making it slightly more difficult to interop between the db and the language (db driver needs to handle custom types, and you need to inject a custom type converter). And while there are hacks you can do to make storing uuid-alikes as strings less terrible for db engines, if you want the best performance and smallest space consumption (compressed or not) make sure to use native ID types or convert to BINARY/numeric types.
In Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
That's how the type is encoded as a string, but type-safety ultimately comes from how the TypeID libraries allow you to validate that the type is correct. For example, the PostgresSQL implementation of TypeID, would let you use a "domain type" to define a typeid subtype. Thus ensuring that the database itself always checks the validity of the type prefix. An example is here: https://github.com/jetpack-io/typeid-sql/blob/main/example/e... In go, we're considering it making it easy to define a new Go type, that enforces a particular type prefix. If you can do that, then the Go type system would enforce you are passing the correct type of id.
In Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.