Fork me on GitHub
#announcements
<
2024-06-26
>
Mitch14:06:07

I have a new library for working with https://github.com/ulid/spec. it targets clojure, clojurescript, and babashka. https://codeberg.org/mitch-kyle/mkyle.ulid

❤️ 16
🎉 8
oyakushev14:06:47

Thank you for fighting the UUID hegemony!

1
Niki19:06:47

This is nice! I’ve been using squuids in datomic in datascript and also tried to come up with more efficient encoding (https://github.com/tonsky/compact-uuids), but ULIDs seem more universal. Hope this catches on

imre09:06:45

The only thing I don't like about ULIDs is that they are case insensitive which means there are still more than one string representations for most of them. I wish the author had just selected upper or lower

imre09:06:32

but there probably was a reason

Lyn Headley09:06:11

I too am a passenger on the ulid train. So far it has been a comfy ride.

Lyn Headley10:06:52

I am generating my ulids in postgres using generate_ulid from here - https://blog.daveallie.com/ulid-primary-keys. The funny thing is they are treated as uuids by both postgres and clojure. I wonder if I could interop with your library.

Mitch10:06:57

Interesting, I'll add a function to convert psuedo-UUIDs to ULIDs; that's easy, but it'll be up to the user to make sure they're using valid ULIDs and not like a UUIDv4 or something. For a more direct interaction with postgres or an sql library some research will be needed.Thanks for the tip

👍 1
Mitch11:06:48

@U08BJGV6E That's why I represent them as integers in the library, the string representation has no bearing on sorting 😉

imre11:06:55

Makes total sense, I just with there was a canonical string representation as well

Mitch13:06:15

I'm pretty sure UUIDs are also case-insensitive but I get what you're saying

imre14:06:13

Yeah they are, so these aren't any worse, I just wish they were stricter in this sense as well. But then that could impact usability from another perspective, I haven't done extensive research 🙂

Mitch16:06:00

@UDF1WUJTH I've just push a new release that adds functions to convert to and from UUIDs as well as before and after predicates for filtering by time

Mitch16:06:25

I've also worked in js/crypto for more secure RNG in clojurescript

Lyn Headley17:06:55

That is great, now I can put these in my urls!

joshuamz21:06:32

@UC9NMGHTN Does your library supercedes clj-ulid? I've been using it for a while in an API without any problems.

Mitch02:06:06

I think so, it's more spec compliant and has more features. The reason I didn't just update that library is because I didn't want to disturb a library that's 7 years without update and risk breaking things for people.

👍 1
Lyn Headley09:06:43

I am using this! Thank you!

🥂 1
Lyn Headley09:06:38

The representation is so much prettier than that of a uuid

Lyn Headley09:06:08

my urls will be lovely

didibus05:07:55

UUIDv7 I think will be lexicographically sortable