Using BIN_TO_UUID / UUID_TO_BIN
I’m trying to understand the best way to use
BIN_TO_UUID
and UUID_TO_BIN
(MySQL).
The below is working fine...
...but I was wondering if there was a better approach, so that the UUID<>BIN
conversion would automatically apply - without having to manually specify it on each query?
Here is an example of what I’m looking for (fromSQL
and toSQL
are made up functions):
Is there any way to do something similar right now?1 Reply
Nevermind... I found a better way to achieve what I was looking for by using custom types with the
binary-uuid
package (https://www.npmjs.com/package/binary-uuid):