quarto icon indicating copy to clipboard operation
quarto copied to clipboard

NaiveDateTime querying

Open jnylen opened this issue 4 years ago • 2 comments
trafficstars

Hi @maartenvanvliet,

When trying to order with a join on a naive datetime field I get:

deps/quarto/lib/quarto/ecto/query.ex:100: value `{:created_at, ~N[2012-06-07 13:03:15]}` in `where` cannot be cast to type :naive_datetime in query:

Query looks like this:

  where: s1.created_at < ^{:created_at, ~N[2012-06-07 13:03:15]} and ^true and ^true,
  order_by: [desc: s1.created_at],

I also notice that you can't paginate on a query that has multiple of the same direction.

I.e. a asc on both created_at and id for example.

jnylen avatar Nov 01 '21 07:11 jnylen

Could you create a failing test case for both issues?

maartenvanvliet avatar Nov 01 '21 07:11 maartenvanvliet

@jnylen does this test cover the first case you described? https://github.com/fastjames/quarto/commit/3755a42234e18f720f0f6282a7382fa2e36f7405

It passes locally for me, so I think I am missing something about the expected setup.

fastjames avatar Jul 25 '22 21:07 fastjames