Fork me on GitHub

hello, what date objects can I store in datahike (using a file-based DB). I tried java.time.LocalDate but I get this exception:


1. Caused by clojure.lang.ExceptionInfo
   Could not write key.
   {:type :write-error, :key :db, :exception #error {
    :cause "Cannot write 2018-09-17 as tag null"
    [{:type java.lang.IllegalArgumentException
      :message "Cannot write 2018-09-17 as tag null"
      :at [org.fressian.handlers.WriteHandlerLookup requireWriteHandler "" 48]}]
    [[org.fressian.handlers.WriteHandlerLookup requireWriteHandler "" 48]
     [org.fressian.FressianWriter writeAs "" 458]
     [org.fressian.FressianWriter writeAs "" 464]
     [org.fressian.FressianWriter writeObject "" 472]


java.util.Date. seems to work, but I’d like to use the newer classes


Hi @U050AACJB, we are only supporting java.util.Date at the moment because we have to write checks and comparators for each new class. What kind of Date classes would you like to see in Datahike?


I was thinking of using the classes Java 8 introduced to address the shortcomings of the older java.util.Date


such as LocalDate, LocalTime, LocalDateTime, ZonedDateTime etc


but I’m only evaluating so please don’t do any extra work on my account!


No problem at all. I'm just trying to understand what kind of use cases we could cover there.


@U050AACJB Are there functions of the newer date classes you want to use in queries? In this case you would have to explicitly convert, which is not a big hassle, but I can understand that this is inconvenient. We could provide convenience functions for that though. If you can do all your reasoning on date itself and only need to convert when inserting into Datahike then this should be straightforward.