-
Notifications
You must be signed in to change notification settings - Fork 13
/
config.yaml
59 lines (56 loc) · 1.9 KB
/
config.yaml
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
configs:
# this is an example config to use the shelldb driver
test:
sources:
- driver: json
filename: test/source.json
- driver: yaml
filename: test/source.yaml
- driver: postgres
filename: test/source.pg.dsn
- driver: postgres
filename: test/source.pg.uri
destination:
driver: shelldb
dsn: my shell program
commands:
- command: /bin/bash
args:
- "-c"
- echo "{{ index . "test/source.json" }}"
# this is an example config to use the fprintf driver
# it will write json of the sources to a file
filewrite:
sources:
- driver: json
filename: test/source.json
destination:
driver: fprintf
# The $tmp variable is a special variable that is the path to a temporary directory
# The hostname endcodes the rendering driver. fmt.Fprintf is the default driver
# which can be specificed by 'fprintf'
dsn: file:///$tmp/myfile.json
commands:
- command: "%s" # commands can have text/templates also
# this is the format string for the fprintf driver
args:
# these are arguments to the fmt.Fprintf function
- '{{ index . "test/source.json" | toJson }}'
# This is an example of executing sql commands in response to a change.
sql:
disabled: true
sources:
- driver: json
filename: test/source.json
destination:
driver: hotload
dsn: fsnotify://postgres/path/to/myfile.txt
commands:
- command: INSERT INTO table1 values ($1, $2);
args:
- '{{ index . "test/source.json" "host" }}'
- '{{ index . "test/source.json" "port" }}'
# As the below query is DDL, unlike insert (DML) written above, we can not pass arguments here.
# We need to put full go template expressions in the command itself
- command: ALTER SERVER myserver OPTIONS (SET host '{{ index . "test/source.json" "host" }}' );
args: []