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

Skip and limit feature #19

Closed
piglovesyou opened this issue Jun 13, 2016 · 3 comments · Fixed by #31
Closed

Skip and limit feature #19

piglovesyou opened this issue Jun 13, 2016 · 3 comments · Fixed by #31

Comments

@piglovesyou
Copy link
Collaborator

piglovesyou commented Jun 13, 2016

Right now this API is in my mind. SyncedDB has a nice and simple syntax to express IDBKeyRange so we can expand it for skip and offset (and filter either in the future, probably).

houses.byStreet.query({
  gt: 'Somewhere 2',
  lte: 'Somewhere 4',
  skip: 20, // <- New API
  limit: 10 // <- New API
})
  • I also came up with method chaining type of API but I prefer above one, because:
    1. SyncedDB does not contain such API design of method chaining for now
    2. Function call for syntax sugar sounds slow for me
  • sdbIndex.inRange can be deprecated in the case
  • .query() will be keeping users away from touching IDBCursor directly
    • So it may need more options for doing equivalently to what IDBCursor can do.
@piglovesyou
Copy link
Collaborator Author

@paldepind I think this topic will interest you as you mentioned in the list.

@piglovesyou
Copy link
Collaborator Author

piglovesyou commented Sep 13, 2016

I changed my mind, using inRange as a method name just makes sense

@piglovesyou
Copy link
Collaborator Author

I force-removed the merged commit and rebased these commits
2586220 b28e0da 2bb9d8f 18d2c30

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

Successfully merging a pull request may close this issue.

1 participant