-
Notifications
You must be signed in to change notification settings - Fork 62
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
Wrapping for database use #143
Comments
So, this is what's up: golang/go#34315 The At first blush, I'm not sure whether this is a bug in I'm not sure there's much I could do on my end other than removing Ideas? |
I'm gonna try opening a PR in |
Sounds good. As for now I've informed sqlboiler users to stick to tagged versions, which they should have been doing anyway. But go get makes it too convenient to not do that and many people are still not using go modules (for very good reasons mind you). |
Hi @ericlagergren, more trouble from the sqlboiler world :)
Issue volatiletech/sqlboiler#607 details the failure to be able to insert our wrapper type into the database anymore. After reconstructing a small sample that looks like this:
I've found the following results:
decimal
this same code fails with an error ofpanic: pq: encode: unknown type for *types.Decimal
(the insert error check line)I don't pretend the blame is not on our end. As we've been marshalling with this basic string-based wrapper for some time now: https://github.com/volatiletech/sqlboiler/blob/master/types/decimal.go#L97-L152
Admittedly quite the hack, but it seems to have worked until now. I suspect the addition of the decomposer interface implementation in the master branch is key (since this issue only hit sqlboiler users on Go 1.13).
What's confusing is that you'd expect lib/pq to pick up the decomposer interface implementation of the underlying decimal and use it correctly. I was hoping to see if you had any insights as to why this might not be working.
The text was updated successfully, but these errors were encountered: