4

I'm writing Tornado application and need to make async N1QL queries. For map-reduce views using txcouchbase (twisted couchbase library) along with tornado-twisted bridge worked fine, but I can't do the same for N1QL queries.

...

from txcouchbase.bucket import Bucket as AsyncBucket
ASYNC_USER_BUCKET = AsyncBucket(**settings.USER_BUCKET_ARGS)

class FooHandler(BaseAPIHandler):
    @schema.validate()
    @authenticated
    @coroutine
    def get(self):
        res = yield ASYNC_USER_BUCKET.n1qlQueryAll("SELECT * FROM farm_user;")
        ...

After executing following query res object is not iterable and looks like this. res object

Seems that _BatchedRowMixin__rows field contains the results of the query, but I'm not sure this is the right and stable way of making async N1QL queries. Are there any other options?

4

1 回答 1

1

您似乎在我们的客户端中发现了一个错误。它已被归档为https://issues.couchbase.com/browse/PYCBC-306。我们的代码审查有一个补丁,应该很快就会合并(http://review.couchbase.org/#/c/56402/)。

于 2015-10-26T18:59:34.823 回答