Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to generate a version1 uuid in Cockroachdb

Our current datastore is Cassandra. We’re planning to move away from it towards Cockroachdb wherein we need to refactor our code(Spring boot). The current scripts use the datatype 'timeuuid' which gives a version1 uuid in Cassandra. Now, I need a similar datatype in CockroachDb which will be feasible to store the existing data (when we migrate in bulk) and also to create new data for that column ('created_at').

I found a builtin in CockroachDb docs which is related to ulid but ulid’s format is different from a version1 uuid.

Any ideas what can I use instead?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

CockroachDB is adding support for the uuid_generate_v1() builtin function in v22.2, which is coming out later in 2022. Until then, you’d need to generate the UUID within your application.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading