Closed omkar-foss closed 1 month ago
Hey @jinzhu, hope you're doing great. It looks like the MariaDB (mariadb:latest, 1.19, ubuntu-latest) runner in GitHub Actions keeps failing with Failed to initialize container mariadb:latest
error (example). This looks to be the case for several other PRs merged to master as well (example).
Any idea what's the issue there? Is it possible to disable the PR check for MariaDB runner until it's fixed?
@omkar-foss I just saw this and think its awesome as im currently using a custom UUID datatype.
One question I have is, is there a reason for storing this as a string and not the raw binary? I store as bytes for efficiency.
@omkar-foss I just saw this and think its awesome as im currently using a custom UUID datatype.
That's great to know @pcfreak30 😁
One question I have is, is there a reason for storing this as a string and not the raw binary? I store as bytes for efficiency.
Great question. The custom datatype UUID
added in this PR is intended to be a wrapper around Google's uuid.UUID
- which currently maps the UUID values to strings (code here). There's also a past discussion referring to the use of bytes for efficiency in Google's uuid.UUID
, check it out here - https://github.com/google/uuid/issues/20.
Having said that, I suppose it'll indeed be a good idea to have a separate custom datatype for UUID being stored as bytes (can call it BinUUID
or ByteUUID
or similar), so users can use either one as per preference. Thanks for bringing this up, I'll raise a PR for this soon.
Update: I've raised PR https://github.com/go-gorm/datatypes/pull/264 to add a new datatype BinUUID
which stores uuid as binary (byte) array in the database. Hope this will be useful.
feature: Add datatype for uuid.UUID (Google UUID)
What did this pull request do?
This PR adds datatype for
uuid.UUID
along with supporting tests.User Case Description
The Google UUID package is a very popular package among Go developers. Since it's used so widely and so often, it'll be great to abstract it out as a separate gorm datatype. This came up as per the discussion on this Gorm PR with @a631807682 and @itanken.