Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Sequel chokes on infinity timestamp #454
I'm trying the following, but sequel doesn't like it. Works fine directly in psql:
How do you think Sequel should handle this? I don't think either Time or DateTime can handle infinity timestamps. Do you want something similar to the MySQL invalid date support, where you can choose to return such timestamps as nil or as a string?
As a workaround, you could probably override Time.parse/DateTime.parse to specially recognize 'infinity' and handle it as you consider appropriate.
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
I'm not entirely sure of the right way to handle it, but it would be great if it could return something. Returning a nil would be just fine. The query is valid in Postgres, and it turns out to be very useful for certain things (i.e. when subtracting two timestamps, if the "end" time is set to infinity, then the duration equals infinity, which guarantees that it is greater than all finite durations).
It looks like AR has similarly considered this issue (rails/rails#544).