sims
1
Hello,
I’m having trouble with the single-arity form of q. If I give this form, I get results:
(d/q '[:find ?e :where [?e :account/account-number 123123]] db)
=> #{[17592186045483]}
If I use the single-arity version, I get an error:
(d/q {:query '[:find ?e :where [?e :account/account-number 123123]] :args [db]})
Execution error (IllegalArgumentException) at datomic.query/validate-query (query.clj:313).
No :find clause specified
This is versions 1.0.6726 and 1.0.7010.
I’d like to use the :limit and :offset functionality provided by the single form. Thanks in advance for any advice/support!
cch1
2
I’m guessing that in the single arity version each arg (just db
in your case) needs to have a corresponding :in
binding. Did you try this:
(d/q {:query '[:find ?e :in [$] :where [?e :account/account-number 123123]] :args [db]}
sims
3
Thanks but unfortunately I still see the same error:
(d/q {:query '[:find ?e :in [$] :where [?e :account/account-number 123123]] :args [db]})
Execution error (IllegalArgumentException) at datomic.query/validate-query (query.clj:313).
No :find clause specified
sims
4
It appears qseq works as expected when passing the arg-map:
(d/qseq {:query '[:find ?e :where [?e :account/account-number 123123]] :args [db]})
=> ([17592186045483])
Appears to be a bug in the q function but I’m new to datomic, happy to be wrong!
sims
5
Is there anyone from Datomic that can comment? Doesn’t seem to be much support available.