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

Support pq driver #35

Open
sebiwi opened this issue May 29, 2024 · 1 comment
Open

Support pq driver #35

sebiwi opened this issue May 29, 2024 · 1 comment

Comments

@sebiwi
Copy link

sebiwi commented May 29, 2024

I'm trying to scan a value into a currency.Amount variable using the pq driver. I'm getting the following error when doing so:

5:12PM ERR PostStore.UserPosts: sql: Scan error on column index 2, name "price": value is not a string: [40 48 46 48 48 48 48 48 44 69 85 82 41]

This comes from here: https://github.com/bojanz/currency/blob/master/amount.go#L365. I guess this is not supported? The documentation says this works with pgx (it does). It works fine for inserts too.

If it is not supported, could it be implemented? Maybe doing something like this: lib/pq#544 (comment).

Thanks!

@bojanz
Copy link
Owner

bojanz commented May 29, 2024

Happy to evaluate a PR that would add pq support!

Won't be working on one myself because pg is in maintenance mode and recommends users use pgx when possible.

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

2 participants