Skip to content

Add feature to store UUID as binary #49

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

Open
x7airworker opened this issue Aug 30, 2023 · 3 comments
Open

Add feature to store UUID as binary #49

x7airworker opened this issue Aug 30, 2023 · 3 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@x7airworker
Copy link
Member

Is your feature request related to a problem? Please describe.
Currently an UUID is always stored as a VARCHAR(36), but since UUIDs are just hex values with seperators, they could be stored in a BINARY(16).

Describe the solution you'd like

  • An option in the Column annotation like preferBinary
  • A setting in the ORMConfig like preferBinaryUuids
@x7airworker x7airworker added the enhancement New feature or request label Aug 30, 2023
@JanHolger
Copy link
Member

Essentially any datatype could be stored in a binary field when marshalling it before, the question is whether this is an actual use-case. If really needed in any project it could probably already be implemented using a TypeMapper.

@x7airworker What are your thought's on this and how realistic do you see this use-case?

@JanHolger JanHolger added the question Further information is requested label Aug 31, 2023
@x7airworker
Copy link
Member Author

@JanHolger The actual use case would be to save disk space, because a BINARY(16) is smaller than a VARCHAR(36). See https://stackoverflow.com/questions/28251144/inserting-and-selecting-uuids-as-binary16 for reference.

@JanHolger
Copy link
Member

Sure I definitely understand that but would anyone every do this? It makes the data pretty unreadable for humans so searching for an id in the database isn't trivial anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants