# Dune v2 info [WIP] -- Changelog ## Changelog ### Overview of changes in Dune v2 * Queries * Saving * Running * Refreshing * Various other upgrades While all the core functionality you expect from Dune is available in Dune v2 the new version of Dune brings changes to how queries and refreshing work, both on the surface and under the hood. ### Queries #### Saving By default, **new queries are not saved** to your queries so you can play around and test various ideas quickly. If you want to keep your work, remember to hit the **Save button** and give your query a name. This means that if you navigate away from a page without saving, your work is lost. If you allow notifications from duneanalytics.com in your browser, the app will notify you when you navigate away from unsaved content. The same applies to forks. A fork is not saved to your queries before you click the **Save button** and give your fork a name. #### Running We've merged the old save and execute buttons for a single button, **Run**. When you click **Run** on a saved query, any changes you've made to the query text is saved and the query is queued for execution. > ***Useful tip:*** Press `CMD / CTRL + Enter` to run your query. **Running query snippets** If you mark parts of your query, the button changes to **Run selection**, and executes the part of the query that you've marked. This will updates the results and visualizations in the process but ***not save*** the query. > ***Useful tip:*** if you want to execute the whole query without saving it, select all of the query (CMD / CTRL + A) and then hit **Run selection**. ### Refreshing There's also changes to how results are refreshed. Over the last months we've been redesigning our entire query execution backend to bring large improvements to how Dune works. When a visualization is viewed, either on a query page or on a dashboard, the Dune backend will inspect the age of the most recent result. If the result is stale (currently defined as >3 hours old), Dune will automatically queue an execution for this query and run it in the background. This means that your dashboards will always be kept up to date when they are being viewed. Query creators does not need to set a refresh scheduele and the scheduling feature has been deprecated as it is no longer needed to keep results fresh. ### Queues We're also bringing changes to how queueing works in Dune. When you manually click **Run** on a query an execution is queued. Every user on Dune can queue 3 queries at the same time (pro users have more, see our [pricing](duneanalytics.com/pricing) page for more info). Automatically refreshed results (as we talked about above) does not use the query creators queuing credits nor the viewing user's. ### Other updates **A faster and better looking Dune** - the whole Dune app including all the charts have gotten a big facelift. The app is now also many times faster. **Query parameters** - what is probably Dune’s most underrated feature has gotten a major upgrade. It’s now super easy to filter any query or dashboard for a token, address or anything really. Meaning you can turn your queries and dashboards into interactive apps for onchain data. **See all content without having to log in** - simply copy and share the link from the page you are on. The exception is for paid users that make their content private, more details on our [pricing page](duneanalytics.com/pricing). **Errors show on the relevant line** - when running your queries you will see error messages directly on the relevant line in your code. We’d love to get your feedback on your experience with Dune v2 in the #feedback channel in our [Discord](https://discord.com/invite/ErrzwBz). You can also contact support@duneanalytics.com if you face any issues. Happy querying! --- # Fredrik below here: ## Query creation ### Running queries There are two main states for a query you are working on: * **An unnamed and unsaved query** * This is what you get when you create a new query (or fork). If you close the tab or move away from the query page the query will be discarded. * You can not share links to your unsaved queries with other users. * **A named and saved query** * When you have a query you want to keep you name it and save it. ### Run a query without saving If you mark parts of your query or the whole query that part will be executed and your query will not be saved. ### Hotkeys for writing queries * Run a query or marked section `CMD / CTRL + Enter` * See SQL commands `Option / ALT + Enter` ## Query and dashboard refreshing Dune will now automatically refresh queries when they are viewed. Query creators don’t need to worry about setting a refresh schedule. Whenever a user looks at a query and the current results are more than three hours old the query will automatically refresh under the hood. There are now two types of queues for running queries on Dune: * **The global queue based on views** * This runs automatically in the background with no user action needed * **Each user's personal queue** * When you manually run queries in the query editor you use your personal queue * Paid users have priority when there's high demand for querying and can put more queries in the queue in parallell. See our [pricing](duneanalytics.com/pricing) page for more info.