Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't query by attribute :db/id instead of :db/ident #549

Open
Peluko opened this issue Jun 29, 2022 · 0 comments
Open

Can't query by attribute :db/id instead of :db/ident #549

Peluko opened this issue Jun 29, 2022 · 0 comments
Labels
bug Something isn't working triage

Comments

@Peluko
Copy link

Peluko commented Jun 29, 2022

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.

@Peluko Peluko added bug Something isn't working triage labels Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
Status: No status
Development

No branches or pull requests

1 participant