Prevent Accidental Deletes with Database and Group Delete Protection

Jamie BartonJamie Barton
Glauber CostaGlauber Costa
Cover image for Prevent Accidental Deletes with Database and Group Delete Protection

We're excited to announce a new feature to help safeguard your important data — Delete Protection for both databases and groups in Turso Cloud.

Accidental deletions can be devastating, especially when dealing with production databases. With Delete Protection, you can prevent accidental deletions of your databases and groups, ensuring that your data remains safe and secure.

Delete Protection is straightforward, and can be used across all of Turso Cloud, no matter which interface you prefer to use.

#Turso Dashboard

Users of Turso Cloud can now configure delete protection for groups and databases right from the Turso Dashboard.

#Turso CLI

You can also configure delete protection for groups and databases using the Turso CLI:

turso group config delete-protection enable <group-name>
turso group config delete-protection disable <group-name>

turso db config delete-protection enable <database-name>
turso db config delete-protection disable <database-name>

If you want to check if delete protection is enabled or not, you can also use the Turso CLI:

turso group config delete-protection show <group-name>
turso db config delete-protection show <database-name>

#Turso Platform API

If you're building with the Turso Platform API, you can programmatically control the status of delete protection for your groups and databases:

curl -L -X PATCH 'https://api.turso.tech/v1/organizations/{organizationSlug}/groups/{groupName}/configuration' \
  -H 'Authorization: Bearer TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
      "delete_protection": true
  }'

curl -L -X PATCH 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases/{databaseName}/configuration' \
  -H 'Authorization: Bearer TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
      "delete_protection": true
  }'

You can also use the API to fetch the current status of delete protection for your groups and databases:

curl -L -X GET 'https://api.turso.tech/v1/organizations/{organizationSlug}/groups/{groupName}/configuration' \
  -H 'Authorization: Bearer TOKEN'

curl -L -X GET 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases/{databaseName}/configuration' \
  -H 'Authorization: Bearer TOKEN'

When protection is enabled, any attempt to delete the group or database will be blocked until protection is explicitly disabled. This ensures that your data remains safe and secure, even in the face of accidental deletions.

#Try it now

You can start using the delete protection configuration from within the Turso Dashboard. If you're using the Turso CLI, make sure to run turso update to get the new commands.

We're always looking for feedback and ideas to improve Turso Cloud, so join us on Discord to share your thoughts with us!

scarf