Issue
When trying to delete a datasource, users may get the error "Cannot delete datasource since it has x queries using it". This article explains the steps to ensure no queries are tied to the datasource and enable users to successfully delete it.
Resolution
To delete a datasource, follow the below steps:
- Delete all queries tied to that particular datasource.
Datasources are workspace-scoped, so you need to ensure that none of the apps from that particular workspace have queries tied to this datasource.
- Once the queries are deleted, make sure to redeploy the apps by clicking the Deploy button on the upper-right corner.
This step is very important because it ensures that the deployed versions of the apps do not use the datasource either.
- Once the queries are deleted, make sure to redeploy the apps by clicking the Deploy button on the upper-right corner.
- Go to Datasources, select the respective datasource, click the 3-dots menu on the upper right, and select Delete.
Upon confirmation, the datasource should be successfully deleted.