Fork me on GitHub

How do i use 2 rules in a single query? This throws an arity error expected 3 got 4

(d/q '[:find ... 
       :in $ % ?p1
       :where [...]]
     db rule1 rule2 p1)
this throws a parsing error
(d/q '[:find ... 
       :in $ % ?p1
       :where [...]]
     db [rule1 rule2]  p1)
Can't find an example on the web for any clojure flavored datalog Am i thinking about this wrong?


I would expect the second version to work. I'm not sure what the problem is without more details. Try looking through for usage examples.



(d/q '[:find ... 
       :in $ % ?p1
       :where [...]]
     db (into rule1 rule) 2 p1)


got the following

Cannot parse clause, expected (data-pattern | pred-expr | fn-expr | rule-expr | not-clause | not-join-clause | or-clause | or-join-clause) tennis 


These are inherited design from Datomic hence Datascript. We will develop a more fully featured rule engine before version 1.0. Stay tuned. Right now, my priority is to finish the query engine rewrite. The rule engine will also rely on a more performant query engine.

😀 1

@U0A74MRCJ thanks! looking forward to it. In this case my rule was wrong. Once i fixed it the query worked. Didn't realize i could do ors and ands. I wish there were a book on clojure's datalog dialect.