Query Editor Query Editor
Use the 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.

AI SQL Completion (Preview)

Use AI to help you write your Spice SQL queries.
  1. 1.
    Ensure the AI SQL Completion button is toggled on.
  2. 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. 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. 4.
    Press Tab to accept the AI-generated completion.
AI generated query recommendation

SQL table, column, and keyword suggestions

The 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. 1.
    Start typing a SQL command, such as SELECT * FROM
  2. 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 btc.blocks table:
    • Type SELECT * FROM btc and press Tab. The editor will suggest btc.blocks as a possible table. Press Enter to insert it into the query.
A list of datasets available in Spice
  • Show the fields in the eth.recent_blocks table:
    • Type SELECT * FROM eth.recent_blocks WHERE ". The editor will list the fields in the table.
The available fields for eth.recent_blocks along with their type.