-
Notifications
You must be signed in to change notification settings - Fork 9
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
Discrepancy between posh q
and datascript q
#10
Comments
I thought it might be because of a datascript version mismatch: I'm using datascript version I tried testing with the older version, though, and datascript version |
Possibly related: somehow the way posh processes queries is not fully compatible the way with datascript does it. For example:
The query above works just fine directly with datascript, but in re-posh (as shown) it results in:
Possibly related, the |
I found part of the problem, but I don't know enough about the internals to know that if changing this will break anything else? So it's a problem here, as
into this:
Then
into this:
Finally,
So I'm unclear which function is misbehaving, should (let [where '[[?e :contact/aka ?name]
[?e :contact/emails ?email]
[(?score-match ?name) ?sort-key]]]
(-> where
(posh.lib.q-analyze/normalize-all-eavs)
;;(posh.lib.q-analyze/get-eavs)
(posh.lib.q-analyze/get-all-vars)))
=> #{?email ?sort-key ?score-match ?e ?name} @denistakeda is there an obvious thing to do here? I'd be happy to write a patch if you can point what the "correct" behaviour is =)... To be clear, just doing this here: vars (vec (get-all-vars where #_eavs)) Does get my code to run, so it's an answer, just not sure if it's breaking some subtle caching behaviour elsewhere... EDIT: An update, I've done some initial transaction / update tests and everything seems to work? Still not 100% confident that it's all good, but maybe? Let me know if you're more confident that me, happy to write a quick PR. Hmm, there also seems to be an odd behaviour with I've been using |
Steps to reproduce:
I'm expecting the
p/q
call to return[2 3]
, just like the theds/q
call. I may be making a simple error, though - I'm just learning how this works.The text was updated successfully, but these errors were encountered: