GithubHelp home page GithubHelp logo

query descending order about history-tools HOT 12 OPEN

eosio avatar eosio commented on June 12, 2024
query descending order

from history-tools.

Comments (12)

Thomas55777 avatar Thomas55777 commented on June 12, 2024

Any update on this. This is still a problem for me. Thank you

from history-tools.

tbfleming avatar tbfleming commented on June 12, 2024

We stopped development on the legacy /v1/history api.

from history-tools.

Thomas55777 avatar Thomas55777 commented on June 12, 2024

Ok thank you for the reply, but the question was not specific to /v1/history but more of a broader question. How can you query in descending order?

from history-tools.

tbfleming avatar tbfleming commented on June 12, 2024

When writing a wasm-ql query handler (C++): both the old-style CDT table API and the new-style CDT KV table API provide support for C++ reverse iteration.

from history-tools.

Thomas55777 avatar Thomas55777 commented on June 12, 2024

I would be very appreciative of an example. I have looked and cannot find one anywhere.

from history-tools.

tbfleming avatar tbfleming commented on June 12, 2024

multi_index's rbegin() and rend() methods. I don't know of any examples, but they behave similar to the C++ standard containers' rbegin() and rend() methods:

https://developers.eos.io/manuals/eosio.cdt/latest/classeosio_1_1multi__index#function-rbegin

from history-tools.

tbfleming avatar tbfleming commented on June 12, 2024

The kv tables have similarly-named methods.

from history-tools.

Thomas55777 avatar Thomas55777 commented on June 12, 2024

I dont understand how that link applies. I have been struggling with this for a while, and this is a common enough requirement that others will also benefit from some instruction of how to do this.

Am I meant to be modifying database.hpp somewhere with the rbegin() and rend() methods?

from history-tools.

tbfleming avatar tbfleming commented on June 12, 2024

database.hpp is obsolete. I don't believe I got around to adding reverse iteration support to it before dumping that API and switching to the 2 CDT table APIs.

from history-tools.

Thomas55777 avatar Thomas55777 commented on June 12, 2024

any examples of 2 CDT table APIs?

Also I take back my reference to database.hpp. My question is a broader, How can this be done?

from history-tools.

tbfleming avatar tbfleming commented on June 12, 2024

See the top of the readme on this branch: https://github.com/EOSIO/history-tools/tree/idea

No examples have made it into the public repos yet for the current direction. The basic idea of the current direction:

  • nodeos on the eos develop branch supports actions returning values. A wasm-ql query is just an action on a contract that returns a result without mutating data.
  • both nodeos and rodes can run wasm-ql queries.
  • rodeos adds parallel execution and filter wasm support.

If you know how to access a table from within an action, you already know how to write a query. Note that hard forks have to be activated and there's a lot still missing.

from history-tools.

baxterjfinch avatar baxterjfinch commented on June 12, 2024

I'm building out wasm-ql queries using the database.hpp and using them in a custom block explorer. Is there any re-usability from the soon-to-be deprecated wasm-ql/database.hpp stuff with regard to the new method (rodeos?) or is the method too different for any sort of refactorization?

from history-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.