Skip to content
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

SQL Value marshall/unmarshall is broken #152

Closed
risentveber opened this issue Oct 4, 2019 · 10 comments
Closed

SQL Value marshall/unmarshall is broken #152

risentveber opened this issue Oct 4, 2019 · 10 comments

Comments

@risentveber
Copy link

Get error when used with gorm:

pq: encode: unknown type for decimal.Decimal

All nice on commit: cd690d0
but broken for the last one: a36b5d8

Also, it would be nice if you will add go mod support.

@risentveber
Copy link
Author

➜  decimal git:(master) git diff cd690d0..a36b5d8 --name-only | cat
.travis.yml
decomposer.go
decomposer_test.go

seems like something is wrong in decomposer.go file

@risentveber
Copy link
Author

See also golang/go#34315

@njason
Copy link
Member

njason commented Nov 25, 2019

commit 75bb2cb has been reverted from master and will be worked on in another branch

@risentveber
Copy link
Author

@njason maybe it's time to add go modules with versioning?

@mwoss
Copy link
Member

mwoss commented Nov 25, 2019

@risentveber We will do it in our next iteration. Stay tuned

@andskor
Copy link

andskor commented Nov 2, 2020

@mwoss any update?

@mwoss
Copy link
Member

mwoss commented Nov 2, 2020

I've tried to recall where our discussion with Jason ended on that, but I'm not quite sure. I have a vague memory that we were waiting for the response from lib/pq maintainers, but I could be wrong. @njason could you elaborate?

@njason
Copy link
Member

njason commented Nov 20, 2020

Using the decomposer-interface branch, which contains the PR that was previously reverted from master, I am still able to reproduce the encoding issue (with go 1.13, latest version of lib/pq). The issue is occurring because this encode function in lib/pq does not support the shopspring Decimal type. @kardianos made a suggestion for a solution that would require database drivers to recognize the decomposer type.

I believe this issue should be closed since SQL value marshalling is no longer broken on master. For now, we can keep the decomposer-interface branch and continue to work with the go community to support the decomposer interface when possible.

@mwoss
Copy link
Member

mwoss commented Nov 22, 2020

Thanks for the detailed explanation, Jason :D
Let's wait for a couple of days before closing the issue, so @andskor and @risentveber will be able to respond to it.

@risentveber
Copy link
Author

@mwoss yeah you can close - tnanks)

@njason njason closed this as completed Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants