I would like to migrate the database from MySQL to MemSQL. Original database use UUID as ID generated by function UUID()
. Is there any possibility, how to use a similar function for generating those ID's?
MemSQL does not have a built-in UUID() function, but you can generate unique ids in various ways, depending on what you need them for, such as:
SHA1(RAND())
, or to get 16 bytes of randomness CONCAT(SUBSTRING(SHA1(RAND()), 1, 16), SUBSTRING(SHA1(RAND()), 1, 16))
. If you need them to follow the UUID format, you can reformat them with string functions