Search code examples
pythonormcassandradatastax-enterprisecassandra-python-driver

How to implement token based pagination using cassandra python-driver?


Yes, iterate over Query is good thing, but i need paging results and send them with token to frontend.

Can i create token for previous page too?

How can i get and use ResponseFuture._paging_state in Models or Querysets.

I search something like Manual paging (Node-JS), but in python


Solution

  • Fixed in python driver v 3.7.0 You can find usage example in tests files on Github

    page_state = result_set.paging_state
    result_set = self.session.execute(
        "SELECT * FROM test3rf.test", paging_state=page_state)