How to support infinity timestamp in ecto (3)

We have two dates date_from and date_to and by default date_to is set to inifinity in migrations

add(:date_to, :utc_datetime, null: false, default: fragment("'infinity'::timestamp"))

How can we get/process this infinity timestamp in ecto(3). would love to hear about any possible workaround

Optional: how would schema model look like(if there is some workaround to handle infinity)?


You could implement a custom Ecto type that deserialises infinity as you wish

It could largely wrap the existing date types.