Query
Understanding Querying
Querying is a process employed to extract data from a database or access state information. The available query messages are typically located in either msg.rs or query.rs, depending on the structure chosen by the contract author.
Performing Queries
Queries can be executed using an external client, such as an API or through the CLI, or within a contract. For further insights into this process, refer to the section on Querying contract state.
Querying in Read-Only Mode
Queries interact with a contract's data store exclusively in a read-only mode. They can retrieve data and conduct additional processing as necessary. However, it's important to note that there is a gas limit associated with query operations.
Managing Queries
Queries are represented as entries within the QueryMsg enum and are handled within the contract's Query function.
Subsequently, the contract proceeds to handle this within the query function.
In this context, query_resolver serves as just another function, while config_read acts as a helper function that encapsulates data store access.
Last updated