Skip to content

Conversation

@girdhar-singh-rathore
Copy link

In many database systems, UUIDs are commonly used as unique identifiers. However, developers often need to write their own custom type handlers to manage UUIDs effectively. To streamline this process and reduce the need for repetitive code, we have included a UUIDTypeHandler in our library. This type handler simplifies the handling of UUIDs in SQL operations, ensuring seamless integration and improved efficiency.

@harawata
Copy link
Member

Thank you for the PR, @girdhar-singh-rathore ,

You are not the first user who proposed UUID type handler (e.g. #1609 ).
We do not provide a built-in UUID type handler because different types are used to store UUID.

VARCHAR or other text type is widely used and you seem to assume it is always the case.
However, PostgreSQL has UUID type and BINARY(16) is a better choice for some other DBs.
This means that different API method (e.g. set/getString, set/getObject, set/getBytes) has to be used in the type handler implementation [1][2].

I am going to close this PR as "won't fix".
Let me know if you need any further clarification.

[1] https://stackoverflow.com/a/62753853/1261766
[2] https://stackoverflow.com/a/74639510/1261766

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants