Spice.xyz Query Editor
Use the Spice.xyz Query Editor to query web3 data from the web portal.
Open the SQL editor by navigating to an app and clicking SQL Query in the sidebar.
Use AI to help you write your Spice SQL queries.
- 1.Ensure the AI SQL Completion button is toggled on.
- 2.Write a SQL comment describing your desired query: E.g.
-- Return the Ethereum block number that had the most cumulative gas fees paid from the past hour
- 3.Press Enter to move the cursor to the next line - this will trigger the auto-completion. It may take a few seconds to generate.
- 4.Press Tab to accept the AI-generated completion.
AI generated query recommendation
The Spice.xyz Query Editor will suggest table and column names along with keywords as you type. You can manually prompt for a suggestion by pressing ctrl+space.
- 1.Start typing a SQL command, such as
SELECT * FROM
- 2.As you type, the Query Editor will suggest possible completions based on the query context. You can use the arrow keys or mouse to select a completion, and then press Enter or Tab to insert it into the editor.
Examples of using the SQL suggestions:
- Select the
SELECT * FROM btcand press Tab. The editor will suggest
btc.blocksas a possible table. Press Enter to insert it into the query.
A list of datasets available in Spice
- Show the fields in the
SELECT * FROM eth.recent_blocks WHERE ". The editor will list the fields in the table.
The available fields for
eth.recent_blocksalong with their type.