-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathetl_siphon.js
49 lines (47 loc) · 937 Bytes
/
etl_siphon.js
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
{
start: {
source: {
uri: "jdbc:mysql://localhost:3306/etlpro?useSSL=false",
user: "root",
password: "hello"
},
target: {
mode: "insert",
uri: "mongodb://localhost:27017/",
namespace: "etlsiphon.orders"
},
template: {
_id: "$id",
first_name: "$first_name",
last_name : "$last_name",
shipping_address : "$shipping_address",
items : [ "@itemsection" ],
tracking : [ "@trackingsection" ]
},
query:{
sql: 'SELECT * FROM orders'
}
},
itemsection : {
template: {
"id" : "$id",
"qty" : "$qty",
"description" : "$description",
"price" : "$price"
},
query : {
sql: "select * from items where order_id = ?"
},
params: [ "id" ]
},
trackingsection : {
template: {
"status" : "$status",
"timestamp" : "$timestamp"
},
query : {
sql: "select * from tracking where order_id = ?"
},
params: [ "id" ]
}
}