-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add support for godoc.org/cloud.google.com/go/civil #837
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
Why civil is so special, as standard library? |
In mysql, time can be negative whereas civil.Time can't represent that. |
All the fields in Time are signed ints. |
Documentation specifies valid range of values, and all are [0,...] , also other methods like civil.Time String() produce nonsense "-12:-10:00". mysql's time is more suited scanning to a time.Duration. |
Perhaps mysql package could introduce a new struct which wraps |
|
How many other DB drivers support it? |
For one thing it's by google. Secondly, it's very popular - even if it's not used with mysql or databases per se. Perhaps this package should basically incorporate it inside. The underlying issue raised (although decorated as a request specific to the civil package) is to incorporate a nice struct for mysql's date and time data types. The civil package is good inspiration on how it should and could be done. |
It's not enough reason, unless it is released on
very? how very?
Since MySQL supports invalid date when configured to support it, |
Anyway, we need example code explains what "support" means. Our goal is providing driver for |
denisenkom/go-mssqldb uses civil types in go1.9+ https://github.com/denisenkom/go-mssqldb/search?q=civil&unscoped_q=civil |
Hmm, mssql added it because of this issue: denisenkom/go-mssqldb#371 Does this project have same issue? |
Civil supports invalid dates |
There are 2 parts to proposal:
|
It's not important than mssql's case because you can use string. See denisenkom/go-mssqldb#380. I'm OK to add API to register https://github.com/denisenkom/go-mssqldb/pull/381/files#diff-04c6e90faac2675aa89e2176d2eec7d8R153 |
@julienschmidt Not sure why methane closed it and made a decision so quickly and unilaterally. Maybe you can over turn him. |
When considered these, I think all you said is very biased and none of them can rationalize to add native support for civil. Less dependency is strength of this package. If you really want change my conclusion, please write more polite proposal. |
@julienschmidt (sorry had to tag you again to bypass @methane) |
If civil is merged into golang.org/x/time/civil, I'm OK to support it. |
It would be good if this package could automatically scan to
civil.Time (https://godoc.org/cloud.google.com/go/civil#Time) time data type
civil.Date (https://godoc.org/cloud.google.com/go/civil#Date) Date data type
The text was updated successfully, but these errors were encountered: