Summary
The where clause on a sanitization rule applies to the entire table. It is not possible to apply different conditions per column within the same table.
Current Limitation
sanitize:
- table: "users"
where: "role != 'admin'" # applies to ALL columns below
columns:
- name: "email"
strategy: "faker"
faker: "email"
If you need email sanitized for inactive users but phone sanitized for all users, you must create two separate table rules which results in two UPDATE statements and verbose config.
Proposed Approach
Allow where at the column level, taking precedence over the table-level where:
sanitize:
- table: "users"
columns:
- name: "email"
strategy: "faker"
faker: "email"
where: "active = false" # column-level override
- name: "phone"
strategy: "faker"
faker: "phone"
# no where — applies to all rows
Acceptance Criteria
Summary
The
whereclause on a sanitization rule applies to the entire table. It is not possible to apply different conditions per column within the same table.Current Limitation
If you need
emailsanitized for inactive users butphonesanitized for all users, you must create two separate table rules which results in two UPDATE statements and verbose config.Proposed Approach
Allow
whereat the column level, taking precedence over the table-levelwhere:Acceptance Criteria
wherefield is valid on individual column entrieswhereoverrides table-levelwherefor that columnvalidatechecks column-levelwhereidentifiers the same as table-levelwherebehavior is unchanged