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

0.5.6 breaks posh/pull #36

Open
metasoarous opened this issue Jun 24, 2019 · 1 comment
Open

0.5.6 breaks posh/pull #36

metasoarous opened this issue Jun 24, 2019 · 1 comment

Comments

@metasoarous
Copy link
Collaborator

I realize that the README suggests the most recent version is 0.5.5. However, I ran lein ancient and it updated to 0.5.6, and it appears that this version has some breakage with respect to posh/pull. It seems that this behavior is specific to pull because posh/q works fine.

The error cropping up in the console is something about get_db not being able to be called on null.

@Quezion
Copy link
Contributor

Quezion commented Oct 19, 2019

@metasoarous Do you have any other details on what broke? A basic pull test works, but I don't have any advanced usage to check against.

(deftest test-basic-pull-reaction
  (testing "Basic pull returns entity reaction which updates on entity's transact"
    (let [conn (dt/create-conn)
          _ (d/posh! conn)
          tran (d/transact! conn [{:a "foo" :b 42}])
          eid (->> (d/q '[:find ?e
                          :where [?e :a "foo"]] conn)
                   deref
                   ffirst)
          entity-reaction (d/pull conn '[*] eid)]
      (is (= (select-keys @entity-reaction [:a :b])
             {:a "foo" :b 42}) "entity-reaction derefs to first transacted value")
      (d/transact! conn [{:a "baz" :b 42}])
      (is (= (select-keys @entity-reaction [:a :b])
             {:a "foo" :b 42}) "entity-reaction contains correct value after unrelated tx")
      (d/transact! conn [(assoc @entity-reaction :a "bar" :b 43)])
      (is (= (select-keys @entity-reaction [:a :b])
             {:a "bar" :b 43}) "entity-reaction derefs to later transacted value"))))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants