-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsample.js
57 lines (49 loc) · 1.61 KB
/
sample.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
50
51
52
53
54
55
56
57
/*
* Sample configuration file for Fliplet Agent
* Usage: fliplet-agent start ./sample.js
*/
module.exports.config = {
// Fliplet authorisation token from Fliplet Studio
authToken: 'eu--123456789',
// Set to true to test the integration without sending any data to Fliplet servers
isDryRun: false,
// If set to true, operations will run when the script starts.
// Otherwise, they will just run according to their frequency.
syncOnInit: true,
// Define the log verbosity, between "debug", "info" and "critical".
logVerbosity: 'debug',
// Define the batch size in which records will be processed. If value not provided default will be 1000
// If mode is set to replace, records will be processed in batch
// else all the records processed at once
batchSize: 1000,
// Database connection settings (using Sequelize format)
// http://docs.sequelizejs.com/
database: {
dialect: 'mssql',
host: 'localhost',
username: 'foo',
password: 'bar',
port: 1234,
database: 'myDatabaseName',
// MSSQL Server only
dialectOptions: {
domain: 'myDomain',
instanceName: 'myInstanceName',
encrypt: false
}
}
};
module.exports.setup = (agent) => {
// Push data from your table to a Fliplet Data Source
agent.push({
description: 'Pushes data from my table to Fliplet',
frequency: '* * * * *',
sourceQuery: (db) => db.query('SELECT id, email, "updatedAt" FROM users order by id asc;'),
primaryColumnName: 'id',
caseInsensitivePrimaryColumn: true,
timestampColumnName: 'updatedAt',
targetDataSourceId: 123,
runHooks: [],
merge: true
});
};