Skip to content

Commit df7c84b

Browse files
committed
Pushing app settings
1 parent 8775361 commit df7c84b

1 file changed

Lines changed: 106 additions & 0 deletions

File tree

QueryPush/appsettings.json

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{
2+
"databases": [
3+
{
4+
"name": "SqlServerDb",
5+
"connectionString": "Driver={ODBC Driver 17 for SQL Server};Server=localhost;Database=MyApp;Trusted_Connection=yes;"
6+
},
7+
{
8+
"name": "MySqlDb",
9+
"connectionString": "Driver={MySQL ODBC 8.0 Unicode Driver};Server=localhost;Database=inventory;Uid=app_user;Pwd=secure_password;"
10+
},
11+
{
12+
"name": "PostgresDb",
13+
"connectionString": "Driver={PostgreSQL Unicode};Server=localhost;Database=analytics;Uid=postgres;Pwd=pg_password;"
14+
},
15+
{
16+
"name": "OracleDb",
17+
"connectionString": "Driver={Oracle in XE};Server=localhost:1521/XE;Uid=hr;Pwd=oracle_pass;"
18+
},
19+
{
20+
"name": "SqliteDb",
21+
"connectionString": "Driver={SQLite3 ODBC Driver};Database=./data/app.db;"
22+
}
23+
],
24+
"endpoints": [
25+
{
26+
"name": "SimpleEndpoint",
27+
"method": "POST",
28+
"url": "https://webhook.site/your-unique-url"
29+
},
30+
{
31+
"name": "ComprehensiveWebhook",
32+
"method": "POST",
33+
"url": "https://api.example.com/webhooks/data",
34+
"retryAttempts": 5,
35+
"retryStrategy": "ExponentialBackoff",
36+
"backOffSeconds": 10,
37+
"sendRequestIfNoResults": true,
38+
"payloadSize": 100,
39+
"requestDelay": 1000,
40+
"headers": [
41+
{
42+
"name": "Authorization",
43+
"value": "Bearer {Env:API_TOKEN}"
44+
},
45+
{
46+
"name": "Content-Type",
47+
"value": "application/json"
48+
},
49+
{
50+
"name": "X-Source",
51+
"value": "QueryPush"
52+
}
53+
]
54+
}
55+
],
56+
"alerts": {
57+
"slack": {
58+
"default": true,
59+
"webhookUrl": "https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK",
60+
"channel": "#alerts",
61+
"username": "QueryPush",
62+
"alertCooldownMinutes": 60
63+
},
64+
"email": {
65+
"smtpHost": "smtp.gmail.com",
66+
"smtpPort": 587,
67+
"useSsl": true,
68+
"from": "alerts@yourcompany.com",
69+
"to": "admin@yourcompany.com",
70+
"username": "alerts@yourcompany.com",
71+
"password": "your-app-password-here",
72+
"alertCooldownMinutes": 60
73+
}
74+
},
75+
"logging": {
76+
"rotationStrategy": "Daily",
77+
"retentionDays": 30,
78+
"logDirectory": "logs"
79+
},
80+
"queries": [
81+
{
82+
"name": "Inventory Check",
83+
"cron": "0 */15 * * * ?",
84+
"runOnStartup": true,
85+
"database": "MySqlDb",
86+
"endpoint": "SimpleEndpoint",
87+
"enabled": true,
88+
"payloadFormat": "JsonLines",
89+
"onFailure": "EmailAlert",
90+
"queryText": "SELECT ProductId, ProductName, StockLevel, ReorderLevel FROM Products WHERE StockLevel < ReorderLevel AND IsActive = 1"
91+
},
92+
{
93+
"name": "Daily User Analytics",
94+
"cron": "0 0 6 * * ?",
95+
"runOnStartup": false,
96+
"database": "SqlServerDb",
97+
"endpoint": "ComprehensiveWebhook",
98+
"enabled": true,
99+
"timeoutSeconds": 120,
100+
"maxRows": 5000,
101+
"payloadFormat": "JsonArray",
102+
"onFailure": "SlackAlert",
103+
"queryText": "SELECT u.UserId, u.Email, u.CreatedDate, COUNT(l.LoginId) as LoginCount FROM Users u LEFT JOIN LoginHistory l ON u.UserId = l.UserId WHERE u.CreatedDate >= '{DateNow|-1:00:00|yyyy-MM-dd}' GROUP BY u.UserId, u.Email, u.CreatedDate ORDER BY u.CreatedDate DESC"
104+
}
105+
]
106+
}

0 commit comments

Comments
 (0)