Delete Query in Reshash

Hello,

I don’t find how to delete old query from Redash.
At the beginning we did à lot of tests and now we need to clean the space.

Thanks for a reply

1 Like

Hi,

as of now, you can’t “delete” a query. but you are able to “archive” it, which removes it from the “Queries” list.
To do so, open the query, in the “…” menu at the top right, you can then select “archive”

3 Likes

It’d be useful to have Delete Query function because users can still access to archived queries.

There’s no application feature that permanently deletes queries (still). It’s just not a high priority when the current workaround is straightforward (see below). But we’re opening to including this in the application. I’d propose a two-stage deletion process:

  1. Trash a query
  2. Empty the trash

With the second step happening on a periodic basis (every 30, 60, 90 days e.g.). We’d love to review a PR implementing this behaviour and happy to answer questions about how to get it going.

Workaround

Meanwhile, an admin with access to Redash’s metadata database can delete queries permanently by running SQL like:

DELETE from queries WHERE queries.is_archived = True and queries.id in (..)

Be careful about this!

1 Like