A repo for keeping track of Sablier's Dune queries, forked from DuneQueryRepo.
[!NOTE] For this repo to work, the API key must be from a Dune Plus plan.
-
Generate an API key in the Dune UI, and put it in a
.env
file. You can create a key under your Dune team settings. -
Type your intended query ids into the
queries.yml
file. The id can be found from the linkhttps://dune.com/queries/<query_id>/...
. If you're creating this for a dashboard, go to the dashboard you want to create a repo and click on the "GitHub" button in the top right of your dashboard to see the query ids. -
Then, run
pull_from_dune.py
to bring in all queries into the/queries
folder.
Make any SQL changes you need to directly in the repo. Then, any time you push a commit to remote, the push_to_dune.py
script will run in CI and push your changes to Dune. You can also run this script manually if you want.
Run the update_query_names.py
script to update the query names on Dune using the names written in the queries.yml
file.
💡: Names of queries are pulled into the file name the first time pull_from_dune.py
is run. Changing the file name in
app or in folder will not affect each other (they aren't synced). Make sure you leave the ___id.sql
at the end of
the file, otherwise the scripts will break!
🟧: Make sure to leave in the comment -- already part of a query repo
at the top of your file. This will hopefully
help prevent others from using it in more than one repo.
➕: If you want to add a query, add it in Dune UI first, then pull the query id from the URL
(dune.com/queries/{id}/other_stuff
) into queries.yml
.
🛑: If you accidentally merge a PR or push a commit that messes up your query in Dune, you can roll back any changes using query version history.
Feel free to dive in! Open an issue, start a discussion or submit a PR. For any informal concerns or feedback, please join our Discord server.
You will need the following software on your machine:
Install dependencies:
just install
To see all available commands, run:
just default
This project is licensed under MIT.