Add missing :date column type#112
Merged
Merged
Conversation
Contributor
Author
|
Breaking all tests might be just a fun way to start contributing to the project. 😂 I'm updating my branch with the latest patch and check these failures. |
joeljuca
commented
May 5, 2023
Comment on lines
+192
to
+194
| test "on %DateTime{} structs", %{datetime: datetime} do | ||
| {:ok, "2011-01-09"} = Codec.date_encode(datetime, :iso8601) | ||
| end |
Contributor
Author
There was a problem hiding this comment.
I'm not sure if date_encode() should support %DateTime{} structs, though.
Member
There was a problem hiding this comment.
Should go check what the postgres adapter does to support this. I think we can truncate and be fine, but that seems like it may cause confusion down the road rather than blow up.
Contributor
Author
There was a problem hiding this comment.
Let's keep it specific to Date structs then. We can expand it in the future if there's a real use case to accept DateTime structs as values in :date fields.
warmwaffles
approved these changes
May 7, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm still new to Ecto adapters so I'm not 100% confident this is the right way to do it, but I noticed that
:datefields are not correctly mapped to the equivalent SQLite data type, so here's a PR trying to fix it.