Is there a recommended pattern for using java.time/instant throughout an application but persisting values with the supported java.util.Date?
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.
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.
@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?
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.
Hi @ramblurr I don't know of a recommended pattern. Sorry.
What kinds of things would you want to see in such a guide? Help with the conversion? Something else?