Repository: xataio/pgstream
Pull request #264 (2025-04-10 10:32:12)

Validate transformer parameters

github-actions[bot]: ### Merging this branch will **increase** overall coverage

| Impacted Packages | Coverage Δ | :robot: |
|-------------------|------------|---------|
| github.com/xataio/pgstream/pkg/transformers | 89.31% (ø) |  |
| github.com/xataio/pgstream/pkg/transformers/builder | 22.81% (**+22.81%**) | :star2: |
| github.com/xataio/pgstream/pkg/transformers/greenmask | 89.11% (ø) |  |
| github.com/xataio/pgstream/pkg/transformers/neosync | 91.30% (ø) |  |

---

<details>

<summary>Coverage by file</summary>

### Changed files (no unit tests)

| Changed File | Coverage Δ | Total | Covered | Missed | :robot: |
|--------------|------------|-------|---------|--------|---------|
| github.com/xataio/pgstream/pkg/transformers/builder/transformer_builder.go | 22.81% (**+22.81%**) | 57 (+39) | 13 (+13) | 44 (+26) | :star2: |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_boolean_transformer.go | 87.50% (ø) | 16 | 14 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_choice_transformer.go | 87.50% (ø) | 24 | 21 | 3 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_date_transformer.go | 80.56% (ø) | 36 | 29 | 7 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_firstname_transformer.go | 96.67% (ø) | 30 | 29 | 1 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_float_transformer.go | 93.33% (ø) | 30 | 28 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_integer_transformer.go | 89.13% (ø) | 46 | 41 | 5 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_string_transformer.go | 91.30% (ø) | 23 | 21 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_timestamp_transformer.go | 94.44% (ø) | 36 | 34 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_unix_timestamp_transformer.go | 86.96% (ø) | 23 | 20 | 3 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_uuid_transformer.go | 84.21% (ø) | 19 | 16 | 3 |  |
| github.com/xataio/pgstream/pkg/transformers/masking_transformer.go | 96.15% (ø) | 26 | 25 | 1 |  |
| github.com/xataio/pgstream/pkg/transformers/neosync/neosync_email_transformer.go | 93.33% (ø) | 30 | 28 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/neosync/neosync_firstname_transformer.go | 85.71% (ø) | 14 | 12 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/neosync/neosync_string_transformer.go | 88.24% (ø) | 17 | 15 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/phone_number_transformer.go | 76.60% (ø) | 47 | 36 | 11 |  |
| github.com/xataio/pgstream/pkg/transformers/string_transformer.go | 90.91% (ø) | 11 | 10 | 1 |  |

_Please note that the "Total", "Covered", and "Missed" counts above refer to ***code statements*** instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code._

### Changed unit test files

- github.com/xataio/pgstream/pkg/transformers/builder/transformer_builder_test.go

</details>

github-actions[bot]: ### Merging this branch will **increase** overall coverage

| Impacted Packages | Coverage Δ | :robot: |
|-------------------|------------|---------|
| github.com/xataio/pgstream/pkg/transformers | 89.31% (ø) |  |
| github.com/xataio/pgstream/pkg/transformers/builder | 22.81% (**+22.81%**) | :star2: |
| github.com/xataio/pgstream/pkg/transformers/greenmask | 89.11% (ø) |  |
| github.com/xataio/pgstream/pkg/transformers/neosync | 91.30% (ø) |  |

---

<details>

<summary>Coverage by file</summary>

### Changed files (no unit tests)

| Changed File | Coverage Δ | Total | Covered | Missed | :robot: |
|--------------|------------|-------|---------|--------|---------|
| github.com/xataio/pgstream/pkg/transformers/builder/transformer_builder.go | 22.81% (**+22.81%**) | 57 (+39) | 13 (+13) | 44 (+26) | :star2: |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_boolean_transformer.go | 87.50% (ø) | 16 | 14 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_choice_transformer.go | 87.50% (ø) | 24 | 21 | 3 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_date_transformer.go | 80.56% (ø) | 36 | 29 | 7 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_firstname_transformer.go | 96.67% (ø) | 30 | 29 | 1 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_float_transformer.go | 93.33% (ø) | 30 | 28 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_integer_transformer.go | 89.13% (ø) | 46 | 41 | 5 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_string_transformer.go | 91.30% (ø) | 23 | 21 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_timestamp_transformer.go | 94.44% (ø) | 36 | 34 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_unix_timestamp_transformer.go | 86.96% (ø) | 23 | 20 | 3 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_uuid_transformer.go | 84.21% (ø) | 19 | 16 | 3 |  |
| github.com/xataio/pgstream/pkg/transformers/masking_transformer.go | 96.15% (ø) | 26 | 25 | 1 |  |
| github.com/xataio/pgstream/pkg/transformers/neosync/neosync_email_transformer.go | 93.33% (ø) | 30 | 28 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/neosync/neosync_firstname_transformer.go | 85.71% (ø) | 14 | 12 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/neosync/neosync_string_transformer.go | 88.24% (ø) | 17 | 15 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/phone_number_transformer.go | 76.60% (ø) | 47 | 36 | 11 |  |
| github.com/xataio/pgstream/pkg/transformers/string_transformer.go | 90.91% (ø) | 11 | 10 | 1 |  |

_Please note that the "Total", "Covered", and "Missed" counts above refer to ***code statements*** instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code._

### Changed unit test files

- github.com/xataio/pgstream/pkg/transformers/builder/transformer_builder_test.go

</details>

github-actions[bot]: ### Merging this branch will **increase** overall coverage

| Impacted Packages | Coverage Δ | :robot: |
|-------------------|------------|---------|
| github.com/xataio/pgstream/pkg/transformers | 89.31% (ø) |  |
| github.com/xataio/pgstream/pkg/transformers/builder | 22.81% (**+22.81%**) | :star2: |
| github.com/xataio/pgstream/pkg/transformers/greenmask | 89.11% (ø) |  |
| github.com/xataio/pgstream/pkg/transformers/neosync | 91.30% (ø) |  |

---

<details>

<summary>Coverage by file</summary>

### Changed files (no unit tests)

| Changed File | Coverage Δ | Total | Covered | Missed | :robot: |
|--------------|------------|-------|---------|--------|---------|
| github.com/xataio/pgstream/pkg/transformers/builder/transformer_builder.go | 22.81% (**+22.81%**) | 57 (+39) | 13 (+13) | 44 (+26) | :star2: |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_boolean_transformer.go | 87.50% (ø) | 16 | 14 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_choice_transformer.go | 87.50% (ø) | 24 | 21 | 3 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_date_transformer.go | 80.56% (ø) | 36 | 29 | 7 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_firstname_transformer.go | 96.67% (ø) | 30 | 29 | 1 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_float_transformer.go | 93.33% (ø) | 30 | 28 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_integer_transformer.go | 89.13% (ø) | 46 | 41 | 5 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_string_transformer.go | 91.30% (ø) | 23 | 21 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_timestamp_transformer.go | 94.44% (ø) | 36 | 34 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_unix_timestamp_transformer.go | 86.96% (ø) | 23 | 20 | 3 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_uuid_transformer.go | 84.21% (ø) | 19 | 16 | 3 |  |
| github.com/xataio/pgstream/pkg/transformers/masking_transformer.go | 96.15% (ø) | 26 | 25 | 1 |  |
| github.com/xataio/pgstream/pkg/transformers/neosync/neosync_email_transformer.go | 93.33% (ø) | 30 | 28 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/neosync/neosync_firstname_transformer.go | 85.71% (ø) | 14 | 12 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/neosync/neosync_string_transformer.go | 88.24% (ø) | 17 | 15 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/phone_number_transformer.go | 76.60% (ø) | 47 | 36 | 11 |  |
| github.com/xataio/pgstream/pkg/transformers/string_transformer.go | 90.91% (ø) | 11 | 10 | 1 |  |

_Please note that the "Total", "Covered", and "Missed" counts above refer to ***code statements*** instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code._

### Changed unit test files

- github.com/xataio/pgstream/pkg/transformers/builder/transformer_builder_test.go

</details>

github-actions[bot]: ### Merging this branch will **increase** overall coverage

| Impacted Packages | Coverage Δ | :robot: |
|-------------------|------------|---------|
| github.com/xataio/pgstream/pkg/transformers | 89.31% (ø) |  |
| github.com/xataio/pgstream/pkg/transformers/builder | 22.81% (**+22.81%**) | :star2: |
| github.com/xataio/pgstream/pkg/transformers/greenmask | 89.11% (ø) |  |
| github.com/xataio/pgstream/pkg/transformers/neosync | 91.30% (ø) |  |

---

<details>

<summary>Coverage by file</summary>

### Changed files (no unit tests)

| Changed File | Coverage Δ | Total | Covered | Missed | :robot: |
|--------------|------------|-------|---------|--------|---------|
| github.com/xataio/pgstream/pkg/transformers/builder/transformer_builder.go | 22.81% (**+22.81%**) | 57 (+39) | 13 (+13) | 44 (+26) | :star2: |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_boolean_transformer.go | 87.50% (ø) | 16 | 14 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_choice_transformer.go | 87.50% (ø) | 24 | 21 | 3 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_date_transformer.go | 80.56% (ø) | 36 | 29 | 7 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_firstname_transformer.go | 96.67% (ø) | 30 | 29 | 1 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_float_transformer.go | 93.33% (ø) | 30 | 28 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_integer_transformer.go | 89.13% (ø) | 46 | 41 | 5 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_string_transformer.go | 91.30% (ø) | 23 | 21 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_timestamp_transformer.go | 94.44% (ø) | 36 | 34 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_unix_timestamp_transformer.go | 86.96% (ø) | 23 | 20 | 3 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_uuid_transformer.go | 84.21% (ø) | 19 | 16 | 3 |  |
| github.com/xataio/pgstream/pkg/transformers/masking_transformer.go | 96.15% (ø) | 26 | 25 | 1 |  |
| github.com/xataio/pgstream/pkg/transformers/neosync/neosync_email_transformer.go | 93.33% (ø) | 30 | 28 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/neosync/neosync_firstname_transformer.go | 85.71% (ø) | 14 | 12 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/neosync/neosync_string_transformer.go | 88.24% (ø) | 17 | 15 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/phone_number_transformer.go | 76.60% (ø) | 47 | 36 | 11 |  |
| github.com/xataio/pgstream/pkg/transformers/string_transformer.go | 90.91% (ø) | 11 | 10 | 1 |  |

_Please note that the "Total", "Covered", and "Missed" counts above refer to ***code statements*** instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code._

### Changed unit test files

- github.com/xataio/pgstream/pkg/transformers/builder/transformer_builder_test.go

</details>

github-actions[bot]: ### Merging this branch will **increase** overall coverage

| Impacted Packages | Coverage Δ | :robot: |
|-------------------|------------|---------|
| github.com/xataio/pgstream/pkg/stream/integration | 0.00% (ø) |  |
| github.com/xataio/pgstream/pkg/transformers | 89.31% (ø) |  |
| github.com/xataio/pgstream/pkg/transformers/builder | 22.81% (**+22.81%**) | :star2: |
| github.com/xataio/pgstream/pkg/transformers/greenmask | 89.11% (ø) |  |
| github.com/xataio/pgstream/pkg/transformers/neosync | 91.30% (ø) |  |

---

<details>

<summary>Coverage by file</summary>

### Changed files (no unit tests)

| Changed File | Coverage Δ | Total | Covered | Missed | :robot: |
|--------------|------------|-------|---------|--------|---------|
| github.com/xataio/pgstream/pkg/transformers/builder/transformer_builder.go | 22.81% (**+22.81%**) | 57 (+39) | 13 (+13) | 44 (+26) | :star2: |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_boolean_transformer.go | 87.50% (ø) | 16 | 14 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_choice_transformer.go | 87.50% (ø) | 24 | 21 | 3 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_date_transformer.go | 80.56% (ø) | 36 | 29 | 7 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_firstname_transformer.go | 96.67% (ø) | 30 | 29 | 1 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_float_transformer.go | 93.33% (ø) | 30 | 28 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_integer_transformer.go | 89.13% (ø) | 46 | 41 | 5 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_string_transformer.go | 91.30% (ø) | 23 | 21 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_timestamp_transformer.go | 94.44% (ø) | 36 | 34 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_unix_timestamp_transformer.go | 86.96% (ø) | 23 | 20 | 3 |  |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_uuid_transformer.go | 84.21% (ø) | 19 | 16 | 3 |  |
| github.com/xataio/pgstream/pkg/transformers/masking_transformer.go | 96.15% (ø) | 26 | 25 | 1 |  |
| github.com/xataio/pgstream/pkg/transformers/neosync/neosync_email_transformer.go | 93.33% (ø) | 30 | 28 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/neosync/neosync_firstname_transformer.go | 85.71% (ø) | 14 | 12 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/neosync/neosync_string_transformer.go | 88.24% (ø) | 17 | 15 | 2 |  |
| github.com/xataio/pgstream/pkg/transformers/phone_number_transformer.go | 76.60% (ø) | 47 | 36 | 11 |  |
| github.com/xataio/pgstream/pkg/transformers/string_transformer.go | 90.91% (ø) | 11 | 10 | 1 |  |

_Please note that the "Total", "Covered", and "Missed" counts above refer to ***code statements*** instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code._

### Changed unit test files

- github.com/xataio/pgstream/pkg/stream/integration/helper_test.go
- github.com/xataio/pgstream/pkg/transformers/builder/transformer_builder_test.go

</details>

github-actions[bot]: ### Merging this branch changes the coverage (3 decrease, 1 increase)

| Impacted Packages | Coverage Δ | :robot: |
|-------------------|------------|---------|
| github.com/xataio/pgstream/pkg/stream/integration | 0.00% (ø) |  |
| github.com/xataio/pgstream/pkg/transformers | 87.50% (**-1.81%**) | :thumbsdown: |
| github.com/xataio/pgstream/pkg/transformers/builder | 22.22% (**+22.22%**) | :star2: |
| github.com/xataio/pgstream/pkg/transformers/greenmask | 86.69% (**-2.42%**) | :thumbsdown: |
| github.com/xataio/pgstream/pkg/transformers/neosync | 88.78% (**-2.53%**) | :thumbsdown: |

---

<details>

<summary>Coverage by file</summary>

### Changed files (no unit tests)

| Changed File | Coverage Δ | Total | Covered | Missed | :robot: |
|--------------|------------|-------|---------|--------|---------|
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_boolean_transformer.go | 83.33% (**-4.17%**) | 18 (+2) | 15 (+1) | 3 (+1) | :thumbsdown: |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_choice_transformer.go | 84.62% (**-2.88%**) | 26 (+2) | 22 (+1) | 4 (+1) | :thumbsdown: |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_date_transformer.go | 78.95% (**-1.61%**) | 38 (+2) | 30 (+1) | 8 (+1) | :thumbsdown: |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_firstname_transformer.go | 93.75% (**-2.92%**) | 32 (+2) | 30 (+1) | 2 (+1) | :thumbsdown: |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_float_transformer.go | 90.62% (**-2.71%**) | 32 (+2) | 29 (+1) | 3 (+1) | :thumbsdown: |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_integer_transformer.go | 87.50% (**-1.63%**) | 48 (+2) | 42 (+1) | 6 (+1) | :thumbsdown: |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_string_transformer.go | 88.00% (**-3.30%**) | 25 (+2) | 22 (+1) | 3 (+1) | :thumbsdown: |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_timestamp_transformer.go | 92.11% (**-2.34%**) | 38 (+2) | 35 (+1) | 3 (+1) | :thumbsdown: |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_unix_timestamp_transformer.go | 84.00% (**-2.96%**) | 25 (+2) | 21 (+1) | 4 (+1) | :thumbsdown: |
| github.com/xataio/pgstream/pkg/transformers/greenmask/greenmask_uuid_transformer.go | 80.95% (**-3.26%**) | 21 (+2) | 17 (+1) | 4 (+1) | :thumbsdown: |
| github.com/xataio/pgstream/pkg/transformers/masking_transformer.go | 92.86% (**-3.30%**) | 28 (+2) | 26 (+1) | 2 (+1) | :thumbsdown: |
| github.com/xataio/pgstream/pkg/transformers/neosync/neosync_email_transformer.go | 90.62% (**-2.71%**) | 32 (+2) | 29 (+1) | 3 (+1) | :thumbsdown: |
| github.com/xataio/pgstream/pkg/transformers/neosync/neosync_firstname_transformer.go | 81.25% (**-4.46%**) | 16 (+2) | 13 (+1) | 3 (+1) | :thumbsdown: |
| github.com/xataio/pgstream/pkg/transformers/neosync/neosync_string_transformer.go | 84.21% (**-4.02%**) | 19 (+2) | 16 (+1) | 3 (+1) | :thumbsdown: |
| github.com/xataio/pgstream/pkg/transformers/phone_number_transformer.go | 75.51% (**-1.09%**) | 49 (+2) | 37 (+1) | 12 (+1) | :thumbsdown: |
| github.com/xataio/pgstream/pkg/transformers/string_transformer.go | 84.62% (**-6.29%**) | 13 (+2) | 11 (+1) | 2 (+1) | :thumbsdown: |
| github.com/xataio/pgstream/pkg/transformers/transformer.go | 96.30% (**-1.58%**) | 54 (+7) | 52 (+6) | 2 (+1) | :thumbsdown: |

_Please note that the "Total", "Covered", and "Missed" counts above refer to ***code statements*** instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code._

### Changed unit test files

- github.com/xataio/pgstream/pkg/stream/integration/helper_test.go
- github.com/xataio/pgstream/pkg/transformers/builder/transformer_builder_test.go

</details>


Patch:
diff --git a/pkg/transformers/greenmask/greenmask_boolean_transformer.go b/pkg/transformers/greenmask/greenmask_boolean_transformer.go
index 1db2487..f79d70d 100644
--- a/pkg/transformers/greenmask/greenmask_boolean_transformer.go
+++ b/pkg/transformers/greenmask/greenmask_boolean_transformer.go
@@ -11,7 +11,12 @@ type BooleanTransformer struct {
 	transformer *greenmasktransformers.RandomBoolean
 }
 
+var booleanTransformerParams = []string{"generator"}
+
 func NewBooleanTransformer(params transformers.Parameters) (*BooleanTransformer, error) {
+	if err := transformers.ValidateParameters(params, booleanTransformerParams); err != nil {
+		return nil, err
+	}
 	t := greenmasktransformers.NewRandomBoolean()
 	if err := setGenerator(t, params); err != nil {
 		return nil, err
diff --git a/pkg/transformers/greenmask/greenmask_choice_transformer.go b/pkg/transformers/greenmask/greenmask_choice_transformer.go
index 1a2f5fa..49cc87c 100644
--- a/pkg/transformers/greenmask/greenmask_choice_transformer.go
+++ b/pkg/transformers/greenmask/greenmask_choice_transformer.go
@@ -15,9 +15,15 @@ type ChoiceTransformer struct {
 	transformer *greenmasktransformers.RandomChoiceTransformer
 }
 
+var choiceTransformerParams = []string{"choices", "generator"}
+
 var errChoicesEmpty = errors.New("greenmask_choice: choices must not be empty")
 
 func NewChoiceTransformer(params transformers.Parameters) (*ChoiceTransformer, error) {
+	if err := transformers.ValidateParameters(params, choiceTransformerParams); err != nil {
+		return nil, err
+	}
+
 	choices := []string{}
 	choices, err := findParameterArray(params, "choices", choices)
 	if err != nil {
diff --git a/pkg/transformers/greenmask/greenmask_date_transformer.go b/pkg/transformers/greenmask/greenmask_date_transformer.go
index c8f9d60..a4cd504 100644
--- a/pkg/transformers/greenmask/greenmask_date_transformer.go
+++ b/pkg/transformers/greenmask/greenmask_date_transformer.go
@@ -14,7 +14,13 @@ type DateTransformer struct {
 	transformer *greenmasktransformers.Timestamp
 }
 
+var dateTransformerParams = []string{"min_value", "max_value", "generator"}
+
 func NewDateTransformer(params transformers.Parameters) (*DateTransformer, error) {
+	if err := transformers.ValidateParameters(params, dateTransformerParams); err != nil {
+		return nil, err
+	}
+
 	minValue, foundMin, err := transformers.FindParameter[string](params, "min_value")
 	if err != nil {
 		return nil, fmt.Errorf("greenmask_date: min_value must be a string: %w", err)
diff --git a/pkg/transformers/greenmask/greenmask_firstname_transformer.go b/pkg/transformers/greenmask/greenmask_firstname_transformer.go
index e7e0762..ccec5d7 100644
--- a/pkg/transformers/greenmask/greenmask_firstname_transformer.go
+++ b/pkg/transformers/greenmask/greenmask_firstname_transformer.go
@@ -16,7 +16,13 @@ type FirstNameTransformer struct {
 
 const genderParam = "gender"
 
+var firstNameTransformerParams = []string{genderParam, "generator"}
+
 func NewFirstNameTransformer(params, dynamicParams transformers.Parameters) (*FirstNameTransformer, error) {
+	if err := transformers.ValidateParameters(params, firstNameTransformerParams); err != nil {
+		return nil, err
+	}
+
 	gender, err := transformers.FindParameterWithDefault(params, genderParam, greenmasktransformers.AnyGenderName)
 	if err != nil {
 		return nil, fmt.Errorf("greenmask_firstname: gender must be a string: %w", err)
diff --git a/pkg/transformers/greenmask/greenmask_float_transformer.go b/pkg/transformers/greenmask/greenmask_float_transformer.go
index 588b751..beb5212 100644
--- a/pkg/transformers/greenmask/greenmask_float_transformer.go
+++ b/pkg/transformers/greenmask/greenmask_float_transformer.go
@@ -21,7 +21,13 @@ type FloatTransformer struct {
 	transformer *greenmasktransformers.RandomFloat64Transformer
 }
 
+var floatTransformerParams = []string{"min_value", "max_value", "precision", "generator"}
+
 func NewFloatTransformer(params transformers.Parameters) (*FloatTransformer, error) {
+	if err := transformers.ValidateParameters(params, floatTransformerParams); err != nil {
+		return nil, err
+	}
+
 	minValue, err := findParameter(params, "min_value", defaultMinFloat)
 	if err != nil {
 		return nil, fmt.Errorf("greenmask_float: min_value must be a float: %w", err)
diff --git a/pkg/transformers/greenmask/greenmask_integer_transformer.go b/pkg/transformers/greenmask/greenmask_integer_transformer.go
index 32121d6..768681c 100644
--- a/pkg/transformers/greenmask/greenmask_integer_transformer.go
+++ b/pkg/transformers/greenmask/greenmask_integer_transformer.go
@@ -22,11 +22,17 @@ type IntegerTransformer struct {
 
 var errUnsupportedSizeError = errors.New("greenmask_integer: size must be 2 or 4")
 
+var integerTransformerParams = []string{"size", "min_value", "max_value", "generator"}
+
 // NewIntegerTransformer creates a new IntegerTransformer with the specified
 // generator and parameters. The size parameter must be 2 or 4, and the
 // min_value and max_value parameters must be valid integers within the range of
 // the specified size.
 func NewIntegerTransformer(params transformers.Parameters) (*IntegerTransformer, error) {
+	if err := transformers.ValidateParameters(params, integerTransformerParams); err != nil {
+		return nil, err
+	}
+
 	size, err := findParameter(params, "size", int(defaultSize))
 	if err != nil {
 		return nil, fmt.Errorf("greenmask_integer: size must be an integer: %w", err)
diff --git a/pkg/transformers/greenmask/greenmask_string_transformer.go b/pkg/transformers/greenmask/greenmask_string_transformer.go
index 486db66..18ec134 100644
--- a/pkg/transformers/greenmask/greenmask_string_transformer.go
+++ b/pkg/transformers/greenmask/greenmask_string_transformer.go
@@ -15,7 +15,13 @@ type StringTransformer struct {
 
 const defaultSymbols = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
 
+var stringTransformerParams = []string{"symbols", "min_length", "max_length", "generator"}
+
 func NewStringTransformer(params transformers.Parameters) (*StringTransformer, error) {
+	if err := transformers.ValidateParameters(params, stringTransformerParams); err != nil {
+		return nil, err
+	}
+
 	symbols, err := findParameter(params, "symbols", defaultSymbols)
 	if err != nil {
 		return nil, fmt.Errorf("greenmask_string: symbols must be a string: %w", err)
diff --git a/pkg/transformers/greenmask/greenmask_timestamp_transformer.go b/pkg/transformers/greenmask/greenmask_timestamp_transformer.go
index 83d84f7..c4ce639 100644
--- a/pkg/transformers/greenmask/greenmask_timestamp_transformer.go
+++ b/pkg/transformers/greenmask/greenmask_timestamp_transformer.go
@@ -20,18 +20,24 @@ var (
 	errInvalidTimestamp            = errors.New("greenmask_timestamp: min_timestamp and max_timestamp must be valid RFC3339 timestamps")
 )
 
+var UTCTimestampTransformerParams = []string{"truncate_part", "min_timestamp", "max_timestamp", "generator"}
+
 func NewUTCTimestampTransformer(params transformers.Parameters) (*UTCTimestampTransformer, error) {
+	if err := transformers.ValidateParameters(params, UTCTimestampTransformerParams); err != nil {
+		return nil, err
+	}
+
 	truncatePart, err := findParameter(params, "truncate_part", "")
 	if err != nil {
-		return nil, fmt.Errorf("greenmask_integer: truncate_part must be a string: %w", err)
+		return nil, fmt.Errorf("greenmask_utc_timestamp: truncate_part must be a string: %w", err)
 	}
 	minDateStr, err := findParameter(params, "min_timestamp", "")
 	if err != nil {
-		return nil, fmt.Errorf("greenmask_integer: min_timestamp must be a string: %w", err)
+		return nil, fmt.Errorf("greenmask_utc_timestamp: min_timestamp must be a string: %w", err)
 	}
 	maxDateStr, err := findParameter(params, "max_timestamp", "")
 	if err != nil {
-		return nil, fmt.Errorf("greenmask_integer: max_timestamp must be a string: %w", err)
+		return nil, fmt.Errorf("greenmask_utc_timestamp: max_timestamp must be a string: %w", err)
 	}
 	if minDateStr == "" || maxDateStr == "" {
 		return nil, errMinMaxTimestampNotSpecified
diff --git a/pkg/transformers/greenmask/greenmask_unix_timestamp_transformer.go b/pkg/transformers/greenmask/greenmask_unix_timestamp_transformer.go
index 790d05a..e85205d 100644
--- a/pkg/transformers/greenmask/greenmask_unix_timestamp_transformer.go
+++ b/pkg/transformers/greenmask/greenmask_unix_timestamp_transformer.go
@@ -13,7 +13,13 @@ import (
 
 var errMinMaxValueNotSpecified = errors.New("min_value and max_value must be specified")
 
+var unixTimestampTransformerParams = []string{"min_value", "max_value", "generator"}
+
 func NewUnixTimestampTransformer(params transformers.Parameters) (*IntegerTransformer, error) {
+	if err := transformers.ValidateParameters(params, unixTimestampTransformerParams); err != nil {
+		return nil, err
+	}
+
 	minValueStr, foundMin, err := transformers.FindParameter[string](params, "min_value")
 	if err != nil {
 		return nil, fmt.Errorf("greenmask_unix_timestamp: min_value must be a string: %w", err)
diff --git a/pkg/transformers/greenmask/greenmask_uuid_transformer.go b/pkg/transformers/greenmask/greenmask_uuid_transformer.go
index 2cf6da1..8b9dc77 100644
--- a/pkg/transformers/greenmask/greenmask_uuid_transformer.go
+++ b/pkg/transformers/greenmask/greenmask_uuid_transformer.go
@@ -12,7 +12,12 @@ type UUIDTransformer struct {
 	transformer *greenmasktransformers.RandomUuidTransformer
 }
 
+var UUIDTransformerParams = []string{"generator"}
+
 func NewUUIDTransformer(params transformers.Parameters) (*UUIDTransformer, error) {
+	if err := transformers.ValidateParameters(params, UUIDTransformerParams); err != nil {
+		return nil, err
+	}
 	t := greenmasktransformers.NewRandomUuidTransformer()
 	if err := setGenerator(t, params); err != nil {
 		return nil, err
diff --git a/pkg/transformers/masking_transformer.go b/pkg/transformers/masking_transformer.go
index ed2cfca..1a8be07 100644
--- a/pkg/transformers/masking_transformer.go
+++ b/pkg/transformers/masking_transformer.go
@@ -32,8 +32,14 @@ type MaskingTransformer struct {
 	maskingFunction maskingFunction
 }
 
+var maskingTransformerParams = []string{"type"}
+
 // NewMaskingTransformer creates a new MaskingTransformer with the given masking function.
 func NewMaskingTransformer(params Parameters) (*MaskingTransformer, error) {
+	if err := ValidateParameters(params, maskingTransformerParams); err != nil {
+		return nil, err
+	}
+
 	var mf maskingFunction
 	maskType, found, err := FindParameter[string](params, "type")
 	if err != nil {
diff --git a/pkg/transformers/neosync/neosync_email_transformer.go b/pkg/transformers/neosync/neosync_email_transformer.go
index 967a25f..6a34816 100644
--- a/pkg/transformers/neosync/neosync_email_transformer.go
+++ b/pkg/transformers/neosync/neosync_email_transformer.go
@@ -30,9 +30,23 @@ var (
 		neosynctransformers.InvalidEmailAction_Null.String(),
 		neosynctransformers.InvalidEmailAction_Generate.String(),
 	}
+
+	emailTransformerParams = []string{
+		"preserve_length",
+		"preserve_domain",
+		"excluded_domains",
+		"max_length",
+		"seed",
+		"email_type",
+		"invalid_email_action",
+	}
 )
 
 func NewEmailTransformer(params transformers.Parameters) (*EmailTransformer, error) {
+	if err := transformers.ValidateParameters(params, emailTransformerParams); err != nil {
+		return nil, err
+	}
+
 	preserveLength, err := findParameter[bool](params, "preserve_length")
 	if err != nil {
 		return nil, fmt.Errorf("neosync_email: preserve_length must be a boolean: %w", err)
diff --git a/pkg/transformers/neosync/neosync_firstname_transformer.go b/pkg/transformers/neosync/neosync_firstname_transformer.go
index 8eaaece..fe34e26 100644
--- a/pkg/transformers/neosync/neosync_firstname_transformer.go
+++ b/pkg/transformers/neosync/neosync_firstname_transformer.go
@@ -13,7 +13,13 @@ type FirstNameTransformer struct {
 	*transformer[string]
 }
 
+var firstNameTransformerParams = []string{"preserve_length", "max_length", "seed"}
+
 func NewFirstNameTransformer(params transformers.Parameters) (*FirstNameTransformer, error) {
+	if err := transformers.ValidateParameters(params, firstNameTransformerParams); err != nil {
+		return nil, err
+	}
+
 	preserveLength, err := findParameter[bool](params, "preserve_length")
 	if err != nil {
 		return nil, fmt.Errorf("neosync_firstname: preserve_length must be a boolean: %w", err)
diff --git a/pkg/transformers/neosync/neosync_string_transformer.go b/pkg/transformers/neosync/neosync_string_transformer.go
index 5c0860e..705ab39 100644
--- a/pkg/transformers/neosync/neosync_string_transformer.go
+++ b/pkg/transformers/neosync/neosync_string_transformer.go
@@ -13,7 +13,13 @@ type StringTransformer struct {
 	*transformer[string]
 }
 
+var stringTransformerParams = []string{"preserve_length", "min_length", "max_length", "seed"}
+
 func NewStringTransformer(params transformers.Parameters) (*StringTransformer, error) {
+	if err := transformers.ValidateParameters(params, stringTransformerParams); err != nil {
+		return nil, err
+	}
+
 	preserveLength, err := findParameter[bool](params, "preserve_length")
 	if err != nil {
 		return nil, fmt.Errorf("neosync_string: preserve_length must be a boolean: %w", err)
diff --git a/pkg/transformers/phone_number_transformer.go b/pkg/transformers/phone_number_transformer.go
index da0bbe5..7aa7846 100644
--- a/pkg/transformers/phone_number_transformer.go
+++ b/pkg/transformers/phone_number_transformer.go
@@ -15,7 +15,13 @@ type PhoneNumberTransformer struct {
 	generator generators.Generator
 }
 
+var phoneNumberTransformerParams = []string{"prefix", "max_length", "min_length", "generator"}
+
 func NewPhoneNumberTransformer(params Parameters) (*PhoneNumberTransformer, error) {
+	if err := ValidateParameters(params, phoneNumberTransformerParams); err != nil {
+		return nil, err
+	}
+
 	prefix, err := FindParameterWithDefault(params, "prefix", "")
 	if err != nil {
 		return nil, fmt.Errorf("phone_number: prefix must be a string: %w", err)
diff --git a/pkg/transformers/string_transformer.go b/pkg/transformers/string_transformer.go
index 940581a..6b2e42f 100644
--- a/pkg/transformers/string_transformer.go
+++ b/pkg/transformers/string_transformer.go
@@ -14,7 +14,12 @@ type StringTransformer struct {
 	// minLength int
 }
 
+var stringTransformerParams = []string{}
+
 func NewStringTransformer(params Parameters) (*StringTransformer, error) {
+	if err := ValidateParameters(params, stringTransformerParams); err != nil {
+		return nil, err
+	}
 	return &StringTransformer{}, nil
 }
 
diff --git a/pkg/transformers/transformer.go b/pkg/transformers/transformer.go
index e2b8a1e..83073dc 100644
--- a/pkg/transformers/transformer.go
+++ b/pkg/transformers/transformer.go
@@ -82,6 +82,7 @@ var (
 	ErrUnsupportedTransformer   = errors.New("unsupported transformer config")
 	ErrInvalidParameters        = errors.New("invalid transformer parameters")
 	ErrInvalidDynamicParameters = errors.New("invalid transformer dynamic parameters")
+	ErrUnknownParameter         = errors.New("unknown parameter provided to transformer")
 )
 
 func NewValue(transformValue any, dynamicValues map[string]any) Value {
@@ -180,3 +181,19 @@ func FindDynamicValue[T any](param *DynamicParameter, dynamicValues map[string]a
 
 	return dynValue, nil
 }
+
+// ValidateParameters checks if all provided parameters are in the expected set
+func ValidateParameters(provided map[string]any, expected []string) error {
+	expectedMap := make(map[string]struct{}, len(expected))
+	for _, param := range expected {
+		expectedMap[param] = struct{}{}
+	}
+
+	for key := range provided {
+		if _, ok := expectedMap[key]; !ok {
+			return fmt.Errorf("%w: unexpected parameter '%s'", ErrUnknownParameter, key)
+		}
+	}
+
+	return nil
+}


Test patch:
diff --git a/pkg/stream/integration/config/integration_test_transformer_rules.yaml b/pkg/stream/integration/config/integration_test_transformer_rules.yaml
index 0b13a1c..ccb468c 100644
--- a/pkg/stream/integration/config/integration_test_transformer_rules.yaml
+++ b/pkg/stream/integration/config/integration_test_transformer_rules.yaml
@@ -25,7 +25,6 @@ transformations:
       address:
         name: greenmask_string
         parameters:
-          preserve_length: false
           max_length: 20
       age:
         name: greenmask_integer
diff --git a/pkg/stream/integration/helper_test.go b/pkg/stream/integration/helper_test.go
index 0196e9f..856247b 100644
--- a/pkg/stream/integration/helper_test.go
+++ b/pkg/stream/integration/helper_test.go
@@ -317,8 +317,7 @@ func testTransformationRules() []transformer.TableRules {
 				"address": {
 					Name: "greenmask_string",
 					Parameters: map[string]any{
-						"preserve_length": false,
-						"max_length":      20,
+						"max_length": 20,
 					},
 				},
 				"age": {
diff --git a/pkg/transformers/builder/transformer_builder_test.go b/pkg/transformers/builder/transformer_builder_test.go
new file mode 100644
index 0000000..ffd5d39
--- /dev/null
+++ b/pkg/transformers/builder/transformer_builder_test.go
@@ -0,0 +1,51 @@
+// SPDX-License-Identifier: Apache-2.0
+
+package builder
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/require"
+	"github.com/xataio/pgstream/pkg/transformers"
+)
+
+func TestNew(t *testing.T) {
+	tests := []struct {
+		name    string
+		config  *transformers.Config
+		wantErr error
+	}{
+		{
+			name: "valid greenmask string transformer",
+			config: &transformers.Config{
+				Name:       transformers.GreenmaskString,
+				Parameters: map[string]any{"max_length": 10},
+			},
+			wantErr: nil,
+		},
+		{
+			name: "invalid parameter for phone number transformer",
+			config: &transformers.Config{
+				Name:       transformers.String,
+				Parameters: map[string]any{"invalid": "param"},
+			},
+			wantErr: transformers.ErrUnknownParameter,
+		},
+		{
+			name: "unsupported transformer",
+			config: &transformers.Config{
+				Name:       "unsupported",
+				Parameters: map[string]any{},
+			},
+			wantErr: transformers.ErrUnsupportedTransformer,
+		},
+	}
+
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			t.Parallel()
+			_, err := New(tt.config)
+			require.ErrorIs(t, err, tt.wantErr)
+		})
+	}
+}