datalevin

John Conti 2025-05-31T21:19:06.650899Z

Using 0.9.22, Writing a java.time.Instant for a value that is :db/valueType :db.type/instant fails with "class java.time.Instant cannot be cast to class java.util.Date". It appears this is because

(defn coerce-inst
  [v]
  (cond
    (inst? v)    v
    (integer? v) (Date. (long v))
    :else        (raise "Expect java.util.Date" {:input v})))
looks like maybe (= java.time.Instant (class v)) (Date/from v) before the (inst? v) clause would be ok. There maybe better ways. I assume the implementation needs to keep java.util.Date.

John Conti 2025-10-28T13:38:32.257799Z

My apologies I have not followed up yet. I have not forgotten.

Huahai 2025-06-01T01:48:15.909169Z

Right, looks like inst? return true for java.sql.Timestamp, java.sql.Date and java.time.Instant , so we need to coerce all these to Date PR welcome

👍 1
amar 2026-06-15T23:46:40.945159Z

hi @huahaiy Ran into this today. I've created a PR https://github.com/datalevin/datalevin/pull/374 Not sure where you might want me to add any tests.

Huahai 2026-06-15T23:48:14.369689Z

A test would be nicer. Thanks.

amar 2026-06-15T23:49:30.127749Z

sure. where would you recommend i put it? not super familiar with the code base. Should I create a ns datalevin.prepare-test?

Huahai 2026-06-15T23:50:18.323739Z

datalevin.test.validation

✔️ 1
amar 2026-06-16T00:02:45.686379Z

test added

Huahai 2026-06-16T02:51:15.244359Z

🙏