ITADN

Instant param with explicit OID

#46Closedmbutlerw 创建于 2025-02-25
M
mbutlerwcommented
Hi, I think somewhere between 0.1.20 and 0.1.33 Instant handling with explicit OIDs changed. What appears to be happening is whichever OID you originally send the instant under, it continues to be sent as that type even if you subsequently change the explicit OID. Each of the below expectations passes on its own, but when ran together only the first will pass (the latter returns the same type as the former). ``` (deftest test-java-time-instant (with-open [conn (pg-conn {:host "localhost" :port 5432 :user "postgres" :database "postgres" :password "xt24"})] (t/is (= [{:v #xt/date-time "2030-01-04T12:44:55"}] (pg/execute conn "SELECT $1 v" {:params [#xt/instant "2030-01-04T12:44:55Z"] :oids [OID/TIMESTAMP]}))) ;; actual: [{:v #xt/date-time "2030-01-04T12:44:55"}] (t/is (= [{:v #xt/offset-date-time "2030-01-04T12:44:55Z"}] (pg/execute conn "SELECT $1 v" {:params [#xt/instant "2030-01-04T12:44:55Z"] :oids [OID/TIMESTAMPTZ]}))))) ```
关闭于 2025-04-26 6 条评论