-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add Scan() support for time.Time #9
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
I would appreciate this and would help if I can. Can you give me a pointer on where to look at? I'm not sure I can do it, but then, I'll try at least. |
Well, there are quite a few problems:
At this point I can't imagine a good solutions without having information about the destination type. So I guess the |
For now I added an example workaround to the wiki. |
I guess this requires some serious magic. For |
About the timezone issue: you could sidestep that problem by advanced guessing ( Still, I'd go with UTC for everything. Document it and leave the conversion to the user - he/she should know the timezone used to fill the database. Totally oblivious DB users probably wouldn't use a language like Go in the first place. Besides, UTC for everything is the only sane way to use date/time types in MySQL anyway. |
I've got one more... does this help with your third issue? |
No, sorry. This doesn't change the fact, that the driver never directly comes in contact with the |
An experimental branch with Scan() support for time.Time is now available. |
I think this would be best to implement as an optional feature, to be enabled by a feature flag in the connection string perhaps. |
I tried the exp-time branch, it works fine. thanks. |
When will exp-time branch merged to master? |
It will be included in the first release candidate (scheduled for 2013-04-20), but it will be an optional behavior which must be activated via the DSN since this still has some limitations (e.g. with sql.RawBytes). The long-term plan is to make this work out-of-the-box, but this needs some work on the database/sql package. |
Is there planned support for mysql |
+1 |
@tigrang @ohohco no time type is planned because there is no matching type in Go. |
Yeah,I have known now. You can use like this : add "the DSN parameter parseTime=true" |
+1 @ohohco THANK YOU!!!!!!!!!! setting the DNS param solved this problem for me. :)
|
+1 @ohohco THANK YOU!!!!!!!!!!
|
+1 for the parseTime trick |
+1 @ohohco Thanks a lot!!! |
+1 ?parseTime=true |
This is Issue 9 moved from a Google Code project.
Added by 2012-07-31T17:38:51.000Z by [email protected].
Please review that bug for more context and additional comments, but update this bug.
Original labels: Type-Enhancement, Priority-Medium
Original description
The text was updated successfully, but these errors were encountered: