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
proposal: databse/sql: add NullUint64 #47953
Comments
Change https://golang.org/cl/344410 mentions this issue: |
Today we have:
Are you suggesting we add all the uint sizes, or just uint64? Why? |
Hey @rsc and thanks for responding. The If you see any concern with adding the rest of the unit types, it can wait for the "generics" change, because they can be implemented externally with |
Most SQL databases don't support uints; though some do. I would recommend we wait for a generic version to land. I was working on one when I encountered a compiler error at tip; once that is resolved I can look into it more. I recommend against this proposal. |
Thanks for the feedback @kardianos 🙏 I don't think it matters if the database supports unsigned integers or not, it can also be defined as Currently, As I mentioned above, unlike |
NullUint64 seems fine in isolation and is the only sized unsigned int type that can't be shoehorned into a signed type instead. @kardianos are you OK with adding NullUint64, or do you want to wait for a generic Null[T]? |
This proposal has been added to the active column of the proposals project |
Thanks for opening this @a8m, on behalf of the Ent community I join your proposal 🙏 |
@rsc I would prefer to wait for a generic Null. Unsigned types are not common in databases. |
Based on the discussion above, this proposal seems like a likely decline. |
Hey @kardianos and @rsc, please read my previous comment. It's unrelated to the fact that MySQL and MariaDB support unsigned integers. The motivation to support |
No change in consensus, so declined. |
Hey! I maintain an entity framework for Go named ent, and we're having troubles handling nullable uint64 types as the official
sql
package doesn't support it. UsingNullInt64
is not enough as some databases accept values that are greater than 2^63−1.Since the
sql.convertAssign
function is private my 2 options are either copy its code or use the//go:linkname
directive.The text was updated successfully, but these errors were encountered: