-
Notifications
You must be signed in to change notification settings - Fork 18k
database/sql/driver: Bool, Int32, String, DefaultParameterConverter are exported, but unsetable #18415
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
Comments
CL https://golang.org/cl/34642 mentions this issue. |
@tgulacsi Supporting more types (both in and out of queries) are something I'd like to see go into go1.9. I'd really like to fix these issues. There should be some sane defaults, driver conversions, and user conversions. In this case, unlike the mailed CL, we can't modify the type, we might be able to introduce new types, but I want to have a master game plan first. |
On https://golang.org/cl/34642 my first attempt was turned down, but my second Patch Set has not been vetted. Maybe after a -2 nobody sees the new Patch Set? Or do they, just I'm impatient? |
This bug is marked Go 1.9, so it doesn't show up on our dashboard. But I don't think we want to change this. It's intentional that the types are private, so they can't be changed. If you want different behavior, you can add new behavior and functions elsewhere, but you shouldn't change global variables and affect existing people's programs. |
Assigning to @kardianos to close or understand the root problem, repurposing this bug or filing new bug(s) as needed. |
Thanks for the clarification, @bradfitz! |
@tgulacsi Would https://go-review.googlesource.com/c/38533/ fix this issue for you? |
I think yes, thanks!
Daniel Theophanes <[email protected]> ezt írta (időpont: 2017. márc.
30., Cs 23:33):
… @tgulacsi <https://github.com/tgulacsi> Would
https://go-review.googlesource.com/c/38533/ fix this issue for you?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18415 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAPoSrrttLvW0dYsUMb3Q4C13gVC2vgNks5rrB-zgaJpZM4LUNTB>
.
|
…erly handle type conversions, handle at least time.Time columns properly by using the column type provided by Crate within the query’s results. driver.DefaultParameterConverter override is scheduled for GO 1.9 (see golang/go#18415)
The above CL has been merged in. I think this issue is now resolved in go1.9. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go1.8beta2
What operating system and processor architecture are you using (
go env
)?linux/amd64
What did you do?
I'm trying to customize the driver.Bool to have it convert from float64 values to bool, too.
What did you expect to see?
I wanted to set driver.Bool to another type, which implements ValueConverter, embeds the original driver.Bool, and thus extend the set of convertable types.
What did you see instead?
var Bool = boolType{}
in driver/types.go, thus nobody can touch it, though it is extended!Is this intended? Can you advice other ways to customize the type conversions?
The text was updated successfully, but these errors were encountered: