1...
2 schedule = "0 23 * * *"
3 haltOnNewColAdd = True
4 jobRes, err = jobclient.CreateJob(ctx, connect.NewRequest({
5 'AccountId': accountId,
6 'JobName': 'prod-to-stage',
7 'ConnectionSourceId': prodDbResp['Msg']['Connection']['Id'],
8 'DestinationSourceIds': [
9 stageDbResp['Msg']['Connection']['Id'],
10 s3Resp['Msg']['Connection']['Id'],
11 ],
12 'CronSchedule': schedule,
13 'HaltOnNewColumnAddition': haltOnNewColAdd,
14 'Mappings': [
15 {
16 'Schema': 'public',
17 'Table': 'users',
18 'Column': 'account_number',
19 'Transformer': JobMappingTransformer.custom_account_number,
20 },
21 {
22 'Schema': 'public',
23 'Table': 'users',
24 'Column': 'address',
25 'Transformer': JobMappingTransformer.address_anonymize,
26 },
27 ],
28 }))
29 if err:
30 raise Exception(err)
31...
1resource "neosync_job" "staging-sync-job" {
2 name = "prod-to-stage"
3
4 source_id = neosync_postgres_connection.prod_db.id
5 destination_ids = [
6 neosync_postgres_connection.stage_db.id,
7 neosync_s3_connection.stage_backup.id,
8 ]
9
10 schedule = "0 23 * * *" # 11pm every night
11
12 halt_on_new_column_addition = false
13
14 mappings = [
15 {
16 "schema" : "public",
17 "table" : "users",
18 "column" : "account_number",
19 "transformer" : "custom_accout_number",
20 },
21 {
22 "schema" : "public",
23 "table" : "users",
24 "column" : "address",
25 "transformer" : "address_anonymize"
26 },
27 ]
28 }