Skip to content

database/sql support #71

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

Open
vtolstov opened this issue Sep 9, 2020 · 1 comment
Open

database/sql support #71

vtolstov opened this issue Sep 9, 2020 · 1 comment

Comments

@vtolstov
Copy link

vtolstov commented Sep 9, 2020

thanks for this package, does it possible to add database/sql support to allow to Scan to decimal value and store it inside db?

@anzdaddy
Copy link
Member

anzdaddy commented Mar 10, 2025

Apologies for the rather tardy response. We're just starting to actively use this package internally and haven't paid the repo much attention till recently.

When you say "Scan" do you mean that you'd like it to implement sql.Scanner and driver.Valuer? It would be tricky to get this right across all database drivers, since both interfaces rely on conversion to and from some other supported type, such as float64, which risks losing precision in the translation process. The simplest approach is to go via strings, but that might not work in all cases. It might with SQLite, for instance, which has quite a fluid type system, but others might not be so forgiving.

If you're still interested in this, let us know and we'll look into it.

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