Skip to content

Commit 460f15f

Browse files
committed
Update docs for literal string transformer
1 parent d5074f1 commit 460f15f

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

docs/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,39 @@ transformations:
952952

953953
</details>
954954

955+
#### Other Transformers
956+
<details>
957+
<summary>literal_string</summary>
958+
959+
**Description:** Transforms all values into the given constant value.
960+
961+
| Supported PostgreSQL types |
962+
| -------------------------------------- |
963+
| All types with a string representation |
964+
965+
| Parameter | Type | Default | Required |
966+
| --------------- | ------ | ------- | -------- |
967+
| literal | string | N/A | Yes |
968+
969+
Below example makes all values in the JSON column `log_message` to become `{'error': null}`.
970+
This transformer can be used for any Postgres type as long as the given string literal has the correct syntax for that type. e.g It can be "5-10-2021" for a date column, or "3.14159265" for a double precision one.
971+
972+
**Example Configuration:**
973+
974+
```yaml
975+
transformations:
976+
table_transformers:
977+
- schema: public
978+
table: logs
979+
column_transformers:
980+
log_message:
981+
name: literal_string
982+
parameters:
983+
literal: "{'error': null}"
984+
```
985+
986+
</details>
987+
955988
### Transformation rules
956989

957990
The rules for the transformers are defined in a dedicated yaml file, with the following format:

0 commit comments

Comments
 (0)