datahike
datahike copied to clipboard
Can't query by attribute :db/id instead of :db/ident
What version of Datahike are you using?
0.5.1506
What version of Java are you using?
17.0.3
What operating system are you using?
Dockerized Ubuntu (clojure:latest image)
What database EDN configuration are you using?
{:store {:backend :mem :id "test-db"}}
Describe the bug
If the :db/id (numeric) instead of the :db/ident (keyword) of the attribute is used in a query, it fails with the error
class java.lang.Long cannot be cast to class clojure.lang.Keyword
Same query on Datomic works without problems.
What is the expected behaviour?
That the query works, like on Datomic.
How can the behaviour be reproduced?
Simple query. First get the numeric id of an attribute, for example '42', then construct the query like:
(d/q '[:find (pull ?d [*])
:where
[?d 42 "foo"]]
db)
This query works on Datomic but fails on Datahike with the above mentioned error.