datahike

https://datahike.io/, Join the conversation at https://discord.com/invite/kEBzMvb, history for this channel is available at https://clojurians.zulipchat.com/#narrow/stream/180378-slack-archive/topic/datahike
Casey 2021-02-22T09:46:37.010400Z

Is there a recommended pattern for using java.time/instant throughout an application but persisting values with the supported java.util.Date?

Casey 2021-02-23T10:23:28.011600Z

Well, it's relatively simple to write wrappers around query/pull and transact to transform those fields, don't need a guide for that necessarily. But I was hoping for a way to provide converters or something so datahike could handle it itself. I'm not sure how this is handled by datomic users, haven't been in that ecosystem at all.

timo 2021-02-23T12:12:51.011800Z

Hi @ramblurr. I am a contributor/maintainer for Datahike. We are happy to take PRs if you see the need and think that it would be helpful for others in the future.

whilo 2021-02-23T17:15:00.024500Z

@ramblurr We have not done any work to incorporate java.time/instant and I am not very familiar with this type. Is there a fallback mechanism in Java that we could easily hook into to treat instants as Dates? For us it is important to use time types that are instants in Clojure, if this is true for java.time/instant then we should extend our schema to support it on the JVM. Can you open an issue?

Casey 2021-02-23T17:24:20.026800Z

by java.time/instant , I mean the java class _java_._time_._Instant_ which is part of the java time api released as part of java 8. Since 2015 or so we haven't used java.util.Date pretty much anywhere, but migrated fully to java.time.Instant. > Is there a fallback mechanism in Java that we could easily hook into to treat instants as Dates? Not sure what this would look like, so I can't rightfully say.

timo 2021-02-22T10:01:55.010800Z

Hi @ramblurr I don't know of a recommended pattern. Sorry.

zane 2021-02-22T17:25:58.011Z

What kinds of things would you want to see in such a guide? Help with the conversion? Something else?