A database is removed from a settings file after a confirmation. The confirmation is a small window which asks "Delete the database" and the full name of the database, and has two buttons: "Cancel" and "Delete". The window is available from release 28.0.
The window is reached with "Delete" in the menu of a tile of [[Invantive Query Tool Multi-Platform/Discover Databases|Discover Databases]] and with "Delete" in the [[Invantive Query Tool Multi-Platform/Database Editor|Database Editor]].
![[20261008-qtm-database-delete.png]]
## What Happens
"Delete" removes the database and the data containers it holds from the settings file which defines it. The tool tip of the button names what will happen: the database, the number of platforms it reads from and the file, such as "The database Demo\Data Dictionary and the one platform it reads from are removed from the settings file 'settings-demo.json'."
Four more things happen without a question:
- A copy of the settings file is written to the backup folder first, named after the file and the moment, so that the definition can be recovered.
- The group is removed together with the last database it held in the file.
- The database leaves the favourites and the recently used databases described in [[Favorite Databases]], whichever of the two it stood in. A favourite which points at a database that is gone could not be removed from any window.
- The credentials of the database leave the [[Invantive Keychain]].
Enter does not delete: the button "Delete" is green because it is what the window is for, and it is not the default button.
## When a Database Is Not Deleted
A database which was found by discovery is not removed, since the next discovery builds it again. The window then states why instead of asking, and its button "Delete" is unavailable: "This database was found by discovery and is rebuilt by the next run, so removing it here would achieve nothing. Untick the database on the Discover Databases window to leave it out."
A database in a settings file which cannot be written is not removed either. The window names the settings file and says that it cannot be written, so the database is not removed. The state of every file is shown in [[Invantive Query Tool Multi-Platform/Settings Files|Settings Files]].