uulid.go
ulid-mssql
uulid.go | ulid-mssql | |
---|---|---|
2 | 1 | |
31 | 40 | |
- | - | |
2.6 | 4.2 | |
6 months ago | 4 months ago | |
Go | TSQL | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
uulid.go
-
New UUID Formats – IETF Draft
For those interested in time based UUIDs, I've written libraries in Ruby and Go to move quickly between them:
https://github.com/sudhirj/uulid.go
-
Timeflake: 128-bit, roughly-ordered, URL-safe UUIDs
There’s a spec called ULID that’s pretty much this with default base32 encoding
https://github.com/ulid/spec
I’ve also worked on a UUID-ULID bridge for Go
https://github.com/sudhirj/uulid.go
And seeing as this is just 128 bits it’s quite easy to move seamlessly between formats and representations.
I’ve found this concept especially useful in nosql stores like DynamoDB, where using a ULID primary key makes objects time sortable automatically. It’s also quite easy to query for items by zeroing out the random component and setting only the time stamp bytes.
ulid-mssql
-
New UUID Formats – IETF Draft
Yeah, it's a small world.
I actually took the opposite path and explored several of the micro-optimized ULID libraries in C# before settling down with NUlid which I decided had the cleanest API and documentation (and reasonably good response times to GitHub issues). The implementation of Cysharp's lib has a lot of Unsafe code, which I understand why they took that path (given the focus on Unity code), but I'm hesitant about it and I liked a lot better (conceptually) how much more Span code mcb2001's CSharp.Ulid library had and if I were to micro-optimize a library that's much more the path that I would take. (But so far micro-optimizations of that sort haven't been a priority in my real world usage and I'll take the well tested library with the nice API.) I created a couple simple extension methods to do the specific "ToSqlGuid()" and "ToUlidFromSql()" that I desired for the SQL Server sort order. (Which is just shuffling the first six bytes of a ULID byte array to the end of the GUID byte array and vice versa.)
I actually trust that I can at least generate ULIDs in SQL Server, again because the part I care to be sorted/needs to be correct (the timestamp) fits into the non-endian-issue portion of a GUID in SQL Server. I've been using just the generator function from ulid-mssql [1] (I used it mostly just for DB migrations and it was nice to have for that). It was debugging the endian issues and Base-32 encoding issues of the "ULID GUID to string" functions where I gave up and decided I didn't trust doing that in database.
[1] https://github.com/rmalayter/ulid-mssql
What are some alternatives?
timeflake - Timeflake is a 128-bit, roughly-ordered, URL-safe UUID.
ksuid - K-Sortable Globally Unique IDs
Pomelo.EntityFrameworkCore.MySql - Entity Framework Core provider for MySQL and MariaDB built on top of MySqlConnector
uuid6-ietf-draft - Next Generation UUID Formats
Ulid - Fast .NET C# Implementation of ULID for .NET and Unity.
lexid - fast lexicographically orderable/sortable ID generator
spec - The canonical spec for ulid
shortuuid.rb - Convert UUIDs & numbers into space efficient and URL-safe Base62 strings, or any other alphabet.
shortuuid - A generator library for concise, unambiguous and URL-safe UUIDs.