sg-index-query
sg-index-query is a Rust crate providing a QueryOptions struct for use in CosmWasm smart contracts.
It allows you to specify query parameters such as limit, order, and the min max of range queries.
Features
QueryOptionsstruct for specifying query parameters such as limit, order, and range.unpackfunction for convertingQueryOptionsintoQueryOptionsInternal, which is used for range queries incw_storage_plus.
Usage
First, add the following to your Cargo.toml:
[]
= "0.1.0"
Then, you can use the QueryOptions struct in your code:
use QueryOptions;
let query_options = default;
You can specify query parameters like so:
use ;
let query_options = QueryOptions ;
Then, you can unpack the QueryOptions into QueryOptionsInternal:
let query_options_internal = query_options.unpack;