Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 1.06 KB

GDPR_RoE.md

File metadata and controls

21 lines (14 loc) · 1.06 KB

GDPR Right of Erasure (Delete)

Any European citizen has the right to ask for his data to be deleted. If the user data is spread across multiple tables, erasing all the user data can be a daunting task.

If all your tables share the same column name for a user identifier, then the operation is quite straightforward. You can select all the tables that have that column, and run a delete statement on all tables at once.

For example, if you want to delete users 1, 2, and 3 from all tables that have a column name user_id, then you can execute:

dx.from_tables("*.*.*")\
  .having_columns("user_id")\
  .with_sql("DELETE FROM {full_table_name} WHERE `user_id` IN (1, 2, 3)"")\
  .display() 
  # You can use .explain() instead of .display() to preview the generated SQL 

Vaccum

Note: You need to regularly vacuum all your delta tables to remove all traces of your deleted rows.

Check out how to vacuum all your tables at once with DiscoverX.