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

QueryResult needs rework #3

Closed
Ukendio opened this issue Jan 7, 2024 · 1 comment
Closed

QueryResult needs rework #3

Ukendio opened this issue Jan 7, 2024 · 1 comment
Assignees
Labels
improvement An imperfection we can make better needs design Needs more planning before continuing

Comments

@Ukendio
Copy link
Member

Ukendio commented Jan 7, 2024

Currently if you use any of the methods of QueryResult it is expected to be used immediately. An example of how this behaviour could be a restriction is that you can't create a Snapshot following a query that has the :without() filter.

There are a few potential solutions:

  1. Make the query lazily loaded, and have the user chain on .build() (or analogous) -This is not very ergonomic at all.
  2. Let without modify the expand and next methods on QueryResult and return a new iterator - It is not clear how we would approach this and what issues it would create.
  3. We add query modifiers and allow that to mark the set of components for which to include and exclude. For example for _ in world:query(With(...), Without(....)). - This is completely changing of the api surface and very unrealistic for us to implement.
@Ukendio Ukendio self-assigned this Jan 7, 2024
@Ukendio Ukendio added the improvement An imperfection we can make better label Jan 7, 2024
@LastTalon LastTalon added the needs design Needs more planning before continuing label Jan 9, 2024
@Ukendio
Copy link
Member Author

Ukendio commented Apr 30, 2024

Fixed in #18

@Ukendio Ukendio closed this as completed Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement An imperfection we can make better needs design Needs more planning before continuing
Projects
None yet
Development

No branches or pull requests

2 participants