Add one more additional filter function {{ drop }}. This function (like {{ null }} function that set column value to NULL) will drop whole row. Another words if table has filters for several columns and at least one of them returns drop value - whole row will be skipped during the anonymization process.
For example:
filters:
orders:
columns:
company_id:
value: "{{ if eq .Values.company_id \"1\" }}{{ .Values.company_id }}{{ else }}{{ drop }}{{ end }}"
name:
type: command
value: /path/to/script.sh
unique: true
With this config file nxs-data-anonymizer drop all rows in orders table excluding row with company_id == 1 (and name field in this row will be anonymized with /path/to/script.sh script).
P.S. You should be careful when using foreign keys in your database.
Add one more additional filter function
{{ drop }}
. This function (like{{ null }}
function that set column value toNULL
) will drop whole row. Another words if table has filters for several columns and at least one of them returnsdrop
value - whole row will be skipped during the anonymization process.For example:
With this config file nxs-data-anonymizer drop all rows in orders table excluding row with
company_id == 1
(andname
field in this row will be anonymized with/path/to/script.sh script
).P.S. You should be careful when using foreign keys in your database.
Issue source: https://t.me/nxs_data_anonymizer_chat/128