replikativ/datahike

[Bug]: as-of is not compatible with datomic as-of

Closed this issue · 0 comments

What version of Datahike are you using?

0.5.1515

What version of Java are you using?

openjdk version "19" 2022-09-20

What operating system are you using?

macos ventura 13.0

What database EDN configuration are you using?

{:store {:backend :mem, :id "testing"},
 :schema-flexibility :write,
 :attribute-refs? true,
 :index :datahike.index/persistent-set,
 :middleware {:query [datahike.middleware.query/timed-query]},
 :keep-history true,
 :name "in-mem"}

Describe the bug

as-of is using timepoints as transaction IDs or transaction IDs. In Datomic you can also use a point in time given by the database as described in the datomic ref.

What is the expected behaviour?

Integers that represent the transaction index should also work.

How can the behaviour be reproduced?

(require '[datahike.api :as d])

(def cfg {:store              {:backend :mem
                               :id      "testing"}
          :schema-flexibility :write
          :attribute-refs?    true
          :index              :datahike.index/persistent-set
          :middleware         {:query ['datahike.middleware.query/timed-query]}
          :keep-history       true
          :name               "in-mem"})

(def conn (d/connect cfg))

(d/q '[:find ?tx
       :in $ ?version
       :where
       [?t :taxonomy-version/id ?version]
       [?t :taxonomy-version/tx ?tx]]
     (d/as-of @conn 15)
     )