entc/sql/decode: fix decoding of NullTime in optional and nillable time fields#60
entc/sql/decode: fix decoding of NullTime in optional and nillable time fields#60htdvisser wants to merge 1 commit into
Conversation
|
Thanks for your contribution @htdvisser. In general, However, sometimes you want to distinguish between zero values and Now, going back to the bug you found - I think we should address it. However, I'm not sure this is the way to go, since godoc for the
My suggestion is to follow the Go standard and remove the BTW, really impressive ramp-up. This reminds me that I need to write a better contribution doc. |
|
For my However, I don't think that |
Agree. @alexsn any thoughts? |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@a8m has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
I'm not sure I see a use case where you'd want to distinguish between not setting time and explicitly setting zero time. If there are such cases then |
…me fields (#60) Summary: While trying out this project I think I found a bug in the generated code when using an optional and nillable time field. ``` vet: ent/user.go:46:16: cannot use &vu.DeletedAt (value of type *sql.NullTime) as *time.Time value in assignment ``` 7438104 made a change to the `{{ $scan }}` struct, which now always uses `{{ $f.NullType }}` as type, so the `$f.IsTime` check can now be removed. This pull request does that. This is my fist contribution here. I hope I didn't miss anything. Pull Request resolved: #60 Differential Revision: D17760925 Pulled By: a8m fbshipit-source-id: 675005be62487b1b9eb77302b8185bd3b6ef0195
|
Thanks for accepting my pull request! I think removing |
|
Thanks for your contribution. |
While trying out this project I think I found a bug in the generated code when using an optional and nillable time field.
7438104 made a change to the
{{ $scan }}struct, which now always uses{{ $f.NullType }}as type, so the$f.IsTimecheck can now be removed. This pull request does that.This is my fist contribution here. I hope I didn't miss anything.