Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UUID format for ULID #28

Closed
budarin opened this issue Jan 16, 2022 · 1 comment
Closed

Add UUID format for ULID #28

budarin opened this issue Jan 16, 2022 · 1 comment

Comments

@budarin
Copy link

budarin commented Jan 16, 2022

In databases, the UUID has size advantages in the internal representation compared to the string representation

https://www.postgresql.org/docs/9.1/datatype-uuid.html
https://dba.stackexchange.com/questions/89429/would-index-lookup-be-noticeably-faster-with-char-vs-varchar-when-all-values-are/89433#89433

@aarondcohen
Copy link
Owner

The uuid type is already supported for db reads and writes. id.toRaw() converts the id to hex, which is compliant with one of the uuid standard formats. Use Ulid.fromRaw for the reads. There might be a bug on the reads where we need to strip - before the conversion.

@budarin budarin closed this as completed May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants