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

Consider supporting OrderBy, Limit #76

Open
eparejatobes opened this issue Jun 8, 2016 · 2 comments
Open

Consider supporting OrderBy, Limit #76

eparejatobes opened this issue Jun 8, 2016 · 2 comments

Comments

@eparejatobes
Copy link
Member

No description provided.

@eparejatobes
Copy link
Member Author

It is pretty common querying by a property p1 and then sort using p2. Fully supporting this (or similar patterns) involves adding complexity to indexes (which I don't like), or having a proper Query interface. For the second option, Queries are built on an element type, and have methods (them or query builders, whatever)

/* for building queries */
<X> Query<FT> and(
  Property<FT,X> property,
  QueryPredicate.Compare predicate,
  X value
);

<X> Query<FT> or(
  Property<FT,X> property,
  QueryPredicate.Compare predicate,
  X value
);

/* this the equivalent of executing the query */
Stream<V> orderByWithLimit(Property<FT,?> property, Int max);

As for the implementation, we could store inside the query a list of predicates together with how they are combined.

@laughedelic WDYT?

@laughedelic
Copy link
Member

If it's only about indexes, I would make just necessary changes in indexes. I see query-builder thing as an overkill for this.

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

No branches or pull requests

2 participants