Skip to content
Snippets Groups Projects
Commit 409d5837 authored by Cam Saül's avatar Cam Saül
Browse files

Fix filtering by minutes on Postgres [ci drivers]

parent 75d9c16a
Branches
Tags
No related merge requests found
......@@ -114,8 +114,8 @@
:seconds (hsql/call :to_timestamp expr)
:milliseconds (recur (hx// expr 1000) :seconds)))
(defn- date-trunc [unit expr] (hsql/call :date_trunc (hx/literal unit) expr))
(defn- extract [unit expr] (hsql/call :extract unit expr))
(defn- date-trunc [unit expr] (hsql/call :date_trunc (hx/literal unit) (hx/cast :timestamp expr)))
(defn- extract [unit expr] (hsql/call :extract unit (hx/cast :timestamp expr)))
(def ^:private extract-integer (comp hx/->integer extract))
......
......@@ -343,3 +343,11 @@
(ql/aggregation (ql/count))
(ql/filter (ql/and (ql/not (ql/> $id 32))
(ql/contains $name "BBQ")))))))
;; make sure that filtering with dates truncating to minutes works (#4632)
(expect-with-non-timeseries-dbs [107] (first-row
(format-rows-by [int]
(data/run-query checkins
(ql/aggregation (ql/count))
(ql/filter (ql/between (ql/datetime-field $date :minute) "2015-01-01T12:30:00" "2015-05-31"))))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment