You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the database type is a date (where there's no time component) and I try to .filter() against it, it doesn't currently work properly. The generated SQL needs to include the ::DATE type specifier.
::DATE is a Postgres-specific syntax, though casting may exist in the other dialects. I'm not sure. More research would need to be done there to take a casting approach.
Another way to achieve this would be to have a DateWithoutTime type in Fluent. This has been brought up a few times before. This would not require any core changes to Fluent and would probably solve a lot of other problems, too.
I think the real problem here is that Swift.Date should really be called Swift.Datetime or Swift.Timestamp. I'm not sure silently discarding time information (as casting Swift.Date to ::DATE would do) is the right approach.
We probably need to create a new Swift type DateOnly (or similar) to encapsulate just a date and make it hook in with Fluent. That should solve the issue
When the database type is a
date
(where there's no time component) and I try to.filter()
against it, it doesn't currently work properly. The generated SQL needs to include the::DATE
type specifier.So for example, I want this query
So you'd immediately do something like so
What that will actually generate is something more like this:
and so it'll never match. What it needs to generate is this:
Of course the ideal state would be to just not include the time components at all :)
The text was updated successfully, but these errors were encountered: