tonsky / datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
Eclipse Public License 1.0
5.49k stars 309 forks source link

pull api: wildcard is not compatible with reverse refs #80

Closed tonsky closed 9 years ago

tonsky commented 9 years ago

If we have wildcard and something else in a pull spec, something else should be merged on top of wildcard pull:

(deftest test-pull-wildcard
  (is (= {:db/id 2 :name "David" :_child [{:db/id 1}]}
         (d/pull test-db '[* :_child] 2))))
FAIL in (datascript.test.pull-api/test-pull-wildcard) (:)
expected: (= {:db/id 2, :name "David", :_child [{:db/id 1}]} (d/pull test-db (quote [* :_child]) 2))
  actual: (not (= {:db/id 2, :name "David", :_child [{:db/id 1}]} {:db/id 2, :name "David"}))
tonsky commented 9 years ago

@dthume fancy take a look?

dthume commented 9 years ago

Sure!

dthume commented 9 years ago

Fix for the given test case pushed to: issue-80; I can't see any outstanding problems with it so, assuming you agree, I think it's safe to merge.

dthume commented 9 years ago

Gah apologies, didn't mean to jump the gun and close it :-)

tonsky commented 9 years ago

Awesome! Thanks a lot!