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

Builtin query method #3

Open
zbyte64 opened this issue May 28, 2015 · 1 comment
Open

Builtin query method #3

zbyte64 opened this issue May 28, 2015 · 1 comment

Comments

@zbyte64
Copy link
Contributor

zbyte64 commented May 28, 2015

Currently the user has to construct a Query object separately. The client should have a helper method to make this process more natural. Borrowing from typical ORM design it would be something like:

var query = client.query('widget').where({color: 'red'});
var widgets = query.fetch();

fetch would return an iterator from the blessed method created in #2

When es6 proxy objects happen, we might be able to do away with the need to explicitly call fetch.

@dmpayton
Copy link

dmpayton commented Aug 3, 2016

I could see a client.query() method that returns a Query instance, but I'm not sure about query.fetch(). Query objects have no knowledge of the client instance.

Since we're already using the client to instantiate a query, is it that onerous to call client.execute(query=query)?

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