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

Named bindings are separate and have no relationship #67

Open
JackSho opened this issue Aug 21, 2023 · 1 comment
Open

Named bindings are separate and have no relationship #67

JackSho opened this issue Aug 21, 2023 · 1 comment
Assignees

Comments

@JackSho
Copy link

JackSho commented Aug 21, 2023

Problem

I use a pattern to filter out such an item from :user/items, this item has a field :store/identity "id2" in :reward/store, when I pull the field item/expired-at of the same level, I got the wrong result, in the following cases, ?expired-at should be 200.

((query '{:user/name  "foo"
          :user/items [{:reward/store    {:store/identity    "id2"
                                          :store/description ?desc}
                        :item/expired-at ?expired-at}]})
 {:user/name  "foo"
  :user/items [{:reward/store    {:store/identity    "id1"
                                  :store/description "description"}
                :item/expired-at 100}
               {:reward/store    {:store/identity    "id2"
                                  :store/description "descriptio2"}
                :item/expired-at 200}]})
;; =>
{?desc "descriptio2"
 &?    #:user{:items [#:item{:expired-at 100}
                      nil]}}

Suggestion

There should be an association between named bindings.

@robertluo
Copy link
Collaborator

I need to rethink the implementation of named queries, it is now using context to implement, and when wrapped query runs successfully, a variable gets updated.

The problem is this design does not reflet relationships of underlying queries, so I am going to try to think naming bindings is a fundamental feature, and it deserves a new kind a basic query.

@robertluo robertluo self-assigned this Aug 30, 2023
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

When branches are created from issues, their pull requests are automatically linked.

2 participants