This is going to be a non-answer to your question but I think the proper way of handling this would be to create a CockroachDB adapter for ecto that can handle these scenarios. The good news is that ~99% of it should already be done.
If you take a look at the official ecto adapters, you will notice that there is a common SQL module that all of the SQL adapters will call. There is no reason we could not do the same with a cockroach adapter calling postgres. We would only need to implement the differences. In this case we could probably do something like
from(
f in Foo,
as_of_system_time: ^"-5m",
where: ...
)
Then the adapter can all the postgres adapter for everything except the :as_of_system_time key and it can do its own thing.
There may be additional work that needs to be done, but this I think would be the way to get started.


















