forked from GreenmaskIO/greenmask
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml.example
143 lines (127 loc) · 3.8 KB
/
config.yml.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
common:
pg_bin_path: "/usr/bin/"
tmp_dir: "/tmp"
log:
level: "info"
format: "text"
storage:
directory:
path: "/tmp/pg_dump_test"
# s3:
# endpoint: "http://localhost:9000"
# bucket: "testbucket"
# region: "us-east-1"
# access_key_id: "Q3AM3UQ867SPQQA43P2F"
# secret_access_key: "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"
dump:
pg_dump_options:
dbname: "host=/run/postgresql user=postgres dbname=demo"
jobs: 10
exclude-schema: "(\"teSt\"*|test*)"
table: "bookings.flights"
load-via-partition-root: true
transformation:
- schema: "public"
name: "account"
transformers:
- name: "RandomInt"
params:
column: "id"
engine: hash
min: 1
max: 2147483647
- name: "RandomChoice"
params:
column: "gender"
values:
- "M"
- "F"
- name: "RandomPerson"
params:
columns:
- name: "first_name"
template: "{{ .FirstName }}"
- name: "last_name"
template: "{{ .LastName }}"
dynamic_params:
gender:
column: gender
- name: "Email"
params:
column: "email"
engine: "hash"
keep_original_domain: true
keep_null: false
local_part_template: "{{ first_name | lower }}.{{ last_name | lower }}"
- name: "RandomDate"
params:
column: "birth_date"
min: '{{ now | tsModify "-30 years" | .EncodeValue }}' # 1994
max: '{{ now | tsModify "-18 years" | .EncodeValue }}' # 2006
- name: "RandomDate"
params:
column: "created_at"
max: "{{ now | .EncodeValue }}"
truncate: "day"
dynamic_params:
min:
column: "birth_date"
template: '{{ .GetValue | tsModify "18 years" | .EncodeValue }}'
- schema: "public"
name: "orders"
transformers:
- name: "RandomInt"
params:
column: "account_id"
engine: hash
min: 1
max: 2147483647
- name: "NoiseNumeric"
params:
column: "total_price"
decimal: 2
min_ratio: 0.1
max_ratio: 0.9
- name: "NoiseDate"
params:
column: "created_at"
max_ratio: "6 day"
min_ratio: "1 day"
truncate: "day"
- name: "RandomDate"
params:
column: "paid_at"
max: '{{ now | .EncodeValue }}'
truncate: "day"
dynamic_params:
min:
column: "created_at"
restore:
pg_restore_options:
jobs: 10
dbname: "host=/run/postgresql user=postgres dbname=demo_restore"
scripts:
pre-data:
- name: "pre-flight test script [1]"
when: "before"
query: "create table script_test(stage text)"
- name: "pre-data before test script [1]"
when: "before"
query: "insert into script_test values('pre-data before')"
- name: "pre-data after test script [1]"
when: "after"
query: "insert into script_test values('pre-data after')"
data:
- name: "data before test script [1]"
when: "before"
query: "insert into script_test values('data before')"
- name: "data after test script [1]"
when: "after"
query: "insert into script_test values('data after')"
post-data:
- name: "post-data before test script [1]"
when: "before"
query: "insert into script_test values('post-data before')"
- name: "post-data after test script [1]"
when: "after"
query: "insert into script_test values('post-data after')"