-
Notifications
You must be signed in to change notification settings - Fork 48
CouchbaseBucket::query return now a CouchbaseResult which implements Iterator #17
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
Conversation
Change-Id: I32582e091c24df90b8bcc3fdaf57a401d518cabf
|
This would change backward compatibility. |
|
Yes but that should be the default behavior. |
|
I can change to this and add Countable interface yes |
|
I added Countable interface |
|
@OXman, I guess it's confusing if you add a countable interface and let that one return the full amount of items in that list. I do neither know if the full amount of this query or the amount of items returned is expected by the user. What do you guess? I expect a collection to return the amount of items it has if I count it. Would yours? I guess when adding a limit, yours wouldn't return the amount of items returned. |
|
Even if i wouldn't return the full amount of data, the C driver does it. And when you add a limit, you want the total number of items for your query (so with the limit). |
|
@OXman yea, but that's not the case if we would take that code you wrote. Please count the rows for the implementation of the You could decide to internally use the limit and query the next set if the user didn't add a limit - then your implementation would be correct, but that needs a lot more work. |
|
Is it ok for you with this sample ? |
|
@OXman Looks good - but I have to admit, that I never tried out the n1ql feature. I was thinking about usual view-queries. Maybe the client returns other additional parameters, that are now inaccessible, when using n1ql ... |
|
Well in view queries you can limit the result set with many options, like startkey, endkey, then the behavior is like N1QL with LIMIT. |
|
@JordyMoos about backward compatibility, semver is designed for that. |
696ef14 to
93d687a
Compare
|
We do not currently have plans in our roadmap to support streaming of results from Couchbase's querying API's. Additionally, because of the nature of streaming, implementing Countable would not be possible if we did. |
Hello,
This feature change the behavior of query to return an Iterator, that a more nice way to return the result and allow code like that :