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

Support query with no condition #125

Closed
greenrobot-team opened this issue Oct 12, 2020 · 1 comment
Closed

Support query with no condition #125

greenrobot-team opened this issue Oct 12, 2020 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Looking for contributors (ideas, comments, code, etc)

Comments

@greenrobot-team
Copy link
Member

Currently building a query requires specifying at least one condition. E.g. to use the upcoming query observer with an all objects query, this results in strange code like

final dummyCondition = dateProp.greaterThan(0);
_query = _box.query(dummyCondition)

Support building a query with no conditions (AFAIK at least OBX for Java allows this as well).

@greenrobot-team greenrobot-team added the enhancement New feature or request label Oct 12, 2020
@vaind vaind added good first issue Good for newcomers help wanted Looking for contributors (ideas, comments, code, etc) labels Oct 21, 2020
@Buggaboo
Copy link
Contributor

Buggaboo commented Oct 21, 2020

Zum Beispiel:

// ...
// getter
Query get emptyQuery { /* return an empty query, skip the queryBuilder */ }
// ...

final query = _box.emptyQuery; // i.e. semantically: we want _everything_, no criteria, no conditions.
query.findStream();

Alternatively, what you also could provide is a stream of all (async) objects from a box, without all this ceremony.

final boxStream = box.stream;
final controller = StreamController<List<Entity>>();
controller.addStream(boxStream);

I'm working on relations, right now. This shouldn't be very hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Looking for contributors (ideas, comments, code, etc)
Projects
None yet
Development

No branches or pull requests

3 participants