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

unsupported driver -> Scan pair: <nil> -> *time.Time #59

Closed
einthusan opened this issue Apr 24, 2013 · 10 comments · Fixed by #63
Closed

unsupported driver -> Scan pair: <nil> -> *time.Time #59

einthusan opened this issue Apr 24, 2013 · 10 comments · Fixed by #63
Assignees
Labels
Milestone

Comments

@einthusan
Copy link

Is this being worked on or... am i just being dumb? My database has empty datetime fields.. otherwise the package works fine.

@julienschmidt
Copy link
Member

So are these fields NULL ?

@arnehormann
Copy link
Member

It's a database/sql issue, which provides no NullTimeValue.
Have a look at issue #9 (esp. the part The driver gets no information about the destination type).

@einthusan
Copy link
Author

Yes it's NULL. As for not being able handle this kind of renders the time.Time support useless? Unless there is some workaround that does indeed use the recently added support for time.Time as oppose to manual string conversion.

@arnehormann
Copy link
Member

You could make the timestamp non-null in the table and use a "marker time". It could even be faster that way.
I know, this advice sucks - but database/sql is not that good at supporting NULLable columns (yet?).

@julienschmidt
Copy link
Member

I'll add a NullTime type to the driver later

@ghost ghost assigned julienschmidt Apr 24, 2013
@arnehormann
Copy link
Member

Just for reference:
The PostreSQL driver uses this NullTime

@einthusan
Copy link
Author

Thanks for that bit of info.. but I really am not sure how to implement this so I will just wait for an official fix to this repo and in the meantime will make the mysql field as non-NULL. This defaults to 0000-00-00 00:00:00

@arnehormann
Copy link
Member

That was intended as a reference for whoever implements NullTime (probably Julien), not for users of the driver 😀 .

@julienschmidt
Copy link
Member

*Juli_e_n
See #63 ;)

@arnehormann
Copy link
Member

Your issue would be...? (thank the Octocat for the edit function...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants