@aaqu/fromcubes-db 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/NOTICE +24 -0
- package/README.md +442 -2
- package/SECURITY.md +75 -0
- package/THIRD-PARTY-NOTICES.md +151 -0
- package/examples/Quick Start/All Databases.json +1719 -0
- package/examples/Quick Start/ClickHouse.json +278 -0
- package/examples/Quick Start/CockroachDB.json +280 -0
- package/examples/Quick Start/Firebird.json +278 -0
- package/examples/Quick Start/MariaDB.json +281 -0
- package/examples/Quick Start/MySQL.json +281 -0
- package/examples/Quick Start/Oracle.json +280 -0
- package/examples/Quick Start/PostgreSQL.json +280 -0
- package/examples/Quick Start/SQL Server.json +282 -0
- package/examples/Quick Start/SQLite.json +278 -0
- package/examples/Quick Start/TiDB.json +281 -0
- package/examples/Quick Start/YugabyteDB.json +280 -0
- package/examples/SQLite Sensor Log With Portal.json +391 -0
- package/examples/Select With Parameters.json +130 -0
- package/index.js +32 -0
- package/lib/adapters/clickhouse.js +254 -0
- package/lib/adapters/firebird.js +416 -0
- package/lib/adapters/index.js +37 -0
- package/lib/adapters/mssql.js +178 -0
- package/lib/adapters/mysql.js +171 -0
- package/lib/adapters/oracle.js +272 -0
- package/lib/adapters/postgres.js +161 -0
- package/lib/adapters/read.js +57 -0
- package/lib/adapters/sqlite.js +193 -0
- package/lib/adapters/time.js +89 -0
- package/lib/bound.js +29 -0
- package/lib/editor-api.js +134 -0
- package/lib/editor-preview.js +191 -0
- package/lib/errors.js +66 -0
- package/lib/params.js +966 -0
- package/lib/pool.js +391 -0
- package/lib/settings.js +302 -0
- package/lib/sql/compile.js +160 -0
- package/lib/sql/dialect.js +194 -0
- package/lib/sql/parse.js +202 -0
- package/lib/sql/types.js +1071 -0
- package/lib/sqlite-files.js +137 -0
- package/nodes/connection.html +728 -0
- package/nodes/connection.js +179 -0
- package/nodes/editor/ark-pixel.LICENSE.txt +96 -0
- package/nodes/editor/ark-pixel.woff2 +0 -0
- package/nodes/editor/mark.svg +5 -0
- package/nodes/editor/sql-editor.css +604 -0
- package/nodes/editor/sql-editor.js +1490 -0
- package/nodes/editor/sql-model.js +203 -0
- package/nodes/icons/fromcubes-db.svg +24 -0
- package/nodes/query.html +662 -0
- package/nodes/query.js +195 -0
- package/package.json +81 -4
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "fcdb-qs-postgres",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "PostgreSQL quick start",
|
|
6
|
+
"disabled": false,
|
|
7
|
+
"info": "**What:** creates the table `fromcubes_demo` on deploy, inserts a row, reads the latest ten back and clears the table — on PostgreSQL.\n\n**How:**\n\nStart a local server:\n\n docker run -d --name fromcubes-postgres -p 5432:5432 -e POSTGRES_USER=test -e POSTGRES_PASSWORD=test -e POSTGRES_DB=test postgres:19.0-alpine\n\nOpen the **PostgreSQL quick start** connection and enter user `test`, password `test` — an example cannot carry credentials.\n\nDeploy, then press the buttons. Both parameters declare their column's type, so `reading: \"abc\"` is refused before it reaches the database.\n\n**Expected:** each result in the Debug sidebar and in the Node-RED log (the terminal it runs in); errors under **error**."
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "fcdb-qs-postgres-note",
|
|
11
|
+
"type": "comment",
|
|
12
|
+
"z": "fcdb-qs-postgres",
|
|
13
|
+
"name": "PostgreSQL: create → insert → select → clear (see the tab's info)",
|
|
14
|
+
"info": "**What:** creates the table `fromcubes_demo` on deploy, inserts a row, reads the latest ten back and clears the table — on PostgreSQL.\n\n**How:**\n\nStart a local server:\n\n docker run -d --name fromcubes-postgres -p 5432:5432 -e POSTGRES_USER=test -e POSTGRES_PASSWORD=test -e POSTGRES_DB=test postgres:19.0-alpine\n\nOpen the **PostgreSQL quick start** connection and enter user `test`, password `test` — an example cannot carry credentials.\n\nDeploy, then press the buttons. Both parameters declare their column's type, so `reading: \"abc\"` is refused before it reaches the database.\n\n**Expected:** each result in the Debug sidebar and in the Node-RED log (the terminal it runs in); errors under **error**.",
|
|
15
|
+
"x": 260,
|
|
16
|
+
"y": 40,
|
|
17
|
+
"wires": []
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "fcdb-qs-postgres-on-deploy",
|
|
21
|
+
"type": "inject",
|
|
22
|
+
"z": "fcdb-qs-postgres",
|
|
23
|
+
"name": "on deploy",
|
|
24
|
+
"props": [
|
|
25
|
+
{
|
|
26
|
+
"p": "payload"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"repeat": "",
|
|
30
|
+
"crontab": "",
|
|
31
|
+
"once": true,
|
|
32
|
+
"onceDelay": "1",
|
|
33
|
+
"topic": "",
|
|
34
|
+
"payload": "",
|
|
35
|
+
"payloadType": "date",
|
|
36
|
+
"x": 140,
|
|
37
|
+
"y": 100,
|
|
38
|
+
"wires": [
|
|
39
|
+
[
|
|
40
|
+
"fcdb-qs-postgres-create"
|
|
41
|
+
]
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "fcdb-qs-postgres-create",
|
|
46
|
+
"type": "fromcubes-db-query",
|
|
47
|
+
"z": "fcdb-qs-postgres",
|
|
48
|
+
"name": "create table",
|
|
49
|
+
"connection": "fcdb-qs-postgres-conn",
|
|
50
|
+
"sql": "CREATE TABLE IF NOT EXISTS fromcubes_demo (\n id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,\n note TEXT NOT NULL,\n reading DOUBLE PRECISION,\n created_at TIMESTAMPTZ NOT NULL DEFAULT now()\n)",
|
|
51
|
+
"params": [],
|
|
52
|
+
"output": "count",
|
|
53
|
+
"target": "payload",
|
|
54
|
+
"timeoutMs": "",
|
|
55
|
+
"x": 340,
|
|
56
|
+
"y": 100,
|
|
57
|
+
"wires": [
|
|
58
|
+
[
|
|
59
|
+
"fcdb-qs-postgres-debug"
|
|
60
|
+
]
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "fcdb-qs-postgres-go",
|
|
65
|
+
"type": "inject",
|
|
66
|
+
"z": "fcdb-qs-postgres",
|
|
67
|
+
"name": "insert a row",
|
|
68
|
+
"props": [
|
|
69
|
+
{
|
|
70
|
+
"p": "payload"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"repeat": "",
|
|
74
|
+
"crontab": "",
|
|
75
|
+
"once": false,
|
|
76
|
+
"onceDelay": "0.1",
|
|
77
|
+
"topic": "",
|
|
78
|
+
"payload": "{\"note\":\"hello\",\"reading\":21.5}",
|
|
79
|
+
"payloadType": "json",
|
|
80
|
+
"x": 150,
|
|
81
|
+
"y": 160,
|
|
82
|
+
"wires": [
|
|
83
|
+
[
|
|
84
|
+
"fcdb-qs-postgres-insert"
|
|
85
|
+
]
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "fcdb-qs-postgres-insert",
|
|
90
|
+
"type": "fromcubes-db-query",
|
|
91
|
+
"z": "fcdb-qs-postgres",
|
|
92
|
+
"name": "insert",
|
|
93
|
+
"connection": "fcdb-qs-postgres-conn",
|
|
94
|
+
"sql": "INSERT INTO fromcubes_demo (note, reading)\nVALUES (:note, :reading)",
|
|
95
|
+
"params": [
|
|
96
|
+
{
|
|
97
|
+
"name": "note",
|
|
98
|
+
"type": "msg",
|
|
99
|
+
"value": "payload.note",
|
|
100
|
+
"as": "text"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "reading",
|
|
104
|
+
"type": "msg",
|
|
105
|
+
"value": "payload.reading",
|
|
106
|
+
"as": "double precision"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"output": "count",
|
|
110
|
+
"target": "inserted",
|
|
111
|
+
"timeoutMs": "",
|
|
112
|
+
"x": 340,
|
|
113
|
+
"y": 160,
|
|
114
|
+
"wires": [
|
|
115
|
+
[
|
|
116
|
+
"fcdb-qs-postgres-select"
|
|
117
|
+
]
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"id": "fcdb-qs-postgres-read",
|
|
122
|
+
"type": "inject",
|
|
123
|
+
"z": "fcdb-qs-postgres",
|
|
124
|
+
"name": "read",
|
|
125
|
+
"props": [
|
|
126
|
+
{
|
|
127
|
+
"p": "payload"
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"repeat": "",
|
|
131
|
+
"crontab": "",
|
|
132
|
+
"once": false,
|
|
133
|
+
"onceDelay": "0.1",
|
|
134
|
+
"topic": "",
|
|
135
|
+
"payload": "",
|
|
136
|
+
"payloadType": "date",
|
|
137
|
+
"x": 130,
|
|
138
|
+
"y": 220,
|
|
139
|
+
"wires": [
|
|
140
|
+
[
|
|
141
|
+
"fcdb-qs-postgres-select"
|
|
142
|
+
]
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"id": "fcdb-qs-postgres-select",
|
|
147
|
+
"type": "fromcubes-db-query",
|
|
148
|
+
"z": "fcdb-qs-postgres",
|
|
149
|
+
"name": "latest 10",
|
|
150
|
+
"connection": "fcdb-qs-postgres-conn",
|
|
151
|
+
"sql": "SELECT id, note, reading, created_at\nFROM fromcubes_demo\nORDER BY id DESC\nLIMIT 10",
|
|
152
|
+
"params": [],
|
|
153
|
+
"output": "rows",
|
|
154
|
+
"target": "payload",
|
|
155
|
+
"timeoutMs": "",
|
|
156
|
+
"x": 540,
|
|
157
|
+
"y": 190,
|
|
158
|
+
"wires": [
|
|
159
|
+
[
|
|
160
|
+
"fcdb-qs-postgres-debug"
|
|
161
|
+
]
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"id": "fcdb-qs-postgres-wipe",
|
|
166
|
+
"type": "inject",
|
|
167
|
+
"z": "fcdb-qs-postgres",
|
|
168
|
+
"name": "clear",
|
|
169
|
+
"props": [
|
|
170
|
+
{
|
|
171
|
+
"p": "payload"
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
"repeat": "",
|
|
175
|
+
"crontab": "",
|
|
176
|
+
"once": false,
|
|
177
|
+
"onceDelay": "0.1",
|
|
178
|
+
"topic": "",
|
|
179
|
+
"payload": "",
|
|
180
|
+
"payloadType": "date",
|
|
181
|
+
"x": 130,
|
|
182
|
+
"y": 280,
|
|
183
|
+
"wires": [
|
|
184
|
+
[
|
|
185
|
+
"fcdb-qs-postgres-clear"
|
|
186
|
+
]
|
|
187
|
+
]
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"id": "fcdb-qs-postgres-clear",
|
|
191
|
+
"type": "fromcubes-db-query",
|
|
192
|
+
"z": "fcdb-qs-postgres",
|
|
193
|
+
"name": "clear table",
|
|
194
|
+
"connection": "fcdb-qs-postgres-conn",
|
|
195
|
+
"sql": "DELETE FROM fromcubes_demo",
|
|
196
|
+
"params": [],
|
|
197
|
+
"output": "count",
|
|
198
|
+
"target": "payload",
|
|
199
|
+
"timeoutMs": "",
|
|
200
|
+
"x": 340,
|
|
201
|
+
"y": 280,
|
|
202
|
+
"wires": [
|
|
203
|
+
[
|
|
204
|
+
"fcdb-qs-postgres-debug"
|
|
205
|
+
]
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"id": "fcdb-qs-postgres-debug",
|
|
210
|
+
"type": "debug",
|
|
211
|
+
"z": "fcdb-qs-postgres",
|
|
212
|
+
"name": "PostgreSQL",
|
|
213
|
+
"active": true,
|
|
214
|
+
"tosidebar": true,
|
|
215
|
+
"console": true,
|
|
216
|
+
"tostatus": true,
|
|
217
|
+
"complete": "payload",
|
|
218
|
+
"targetType": "msg",
|
|
219
|
+
"statusVal": "payload",
|
|
220
|
+
"statusType": "auto",
|
|
221
|
+
"x": 760,
|
|
222
|
+
"y": 190,
|
|
223
|
+
"wires": []
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"id": "fcdb-qs-postgres-catch",
|
|
227
|
+
"type": "catch",
|
|
228
|
+
"z": "fcdb-qs-postgres",
|
|
229
|
+
"name": "database errors",
|
|
230
|
+
"scope": null,
|
|
231
|
+
"uncaught": false,
|
|
232
|
+
"x": 140,
|
|
233
|
+
"y": 340,
|
|
234
|
+
"wires": [
|
|
235
|
+
[
|
|
236
|
+
"fcdb-qs-postgres-error"
|
|
237
|
+
]
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"id": "fcdb-qs-postgres-error",
|
|
242
|
+
"type": "debug",
|
|
243
|
+
"z": "fcdb-qs-postgres",
|
|
244
|
+
"name": "error",
|
|
245
|
+
"active": true,
|
|
246
|
+
"tosidebar": true,
|
|
247
|
+
"console": true,
|
|
248
|
+
"tostatus": false,
|
|
249
|
+
"complete": "true",
|
|
250
|
+
"targetType": "full",
|
|
251
|
+
"statusVal": "",
|
|
252
|
+
"statusType": "auto",
|
|
253
|
+
"x": 340,
|
|
254
|
+
"y": 340,
|
|
255
|
+
"wires": []
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"id": "fcdb-qs-postgres-conn",
|
|
259
|
+
"type": "fromcubes-db-connection",
|
|
260
|
+
"name": "PostgreSQL quick start",
|
|
261
|
+
"dialect": "postgres",
|
|
262
|
+
"userSource": "cred",
|
|
263
|
+
"passwordSource": "cred",
|
|
264
|
+
"poolMin": 0,
|
|
265
|
+
"poolMax": 10,
|
|
266
|
+
"idleTimeoutMs": 30000,
|
|
267
|
+
"connectTimeoutMs": 15000,
|
|
268
|
+
"queryTimeoutMs": 30000,
|
|
269
|
+
"queueMax": 100,
|
|
270
|
+
"undefinedAsNull": false,
|
|
271
|
+
"options": "",
|
|
272
|
+
"host": "localhost",
|
|
273
|
+
"port": 5432,
|
|
274
|
+
"database": "test",
|
|
275
|
+
"pgSsl": "disable",
|
|
276
|
+
"pgCa": "",
|
|
277
|
+
"pgSchema": "",
|
|
278
|
+
"appName": ""
|
|
279
|
+
}
|
|
280
|
+
]
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "fcdb-qs-mssql",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "SQL Server quick start",
|
|
6
|
+
"disabled": false,
|
|
7
|
+
"info": "**What:** creates the table `fromcubes_demo` on deploy, inserts a row, reads the latest ten back and clears the table — on SQL Server.\n\n**How:**\n\nStart a local server:\n\n docker run -d --platform linux/amd64 --name fromcubes-mssql -p 1433:1433 -e ACCEPT_EULA=Y -e 'MSSQL_SA_PASSWORD=Str0ng!Passw0rd' mcr.microsoft.com/mssql/server:2025-latest\n\nOpen the **SQL Server quick start** connection and enter user `sa`, password `Str0ng!Passw0rd` — an example cannot carry credentials.\n\n**Trust server certificate** is on for the self-signed certificate of a local container. Turn it off for a real server.\n\nDeploy, then press the buttons. Both parameters declare their column's type, so `reading: \"abc\"` is refused before it reaches the database.\n\n**Expected:** each result in the Debug sidebar and in the Node-RED log (the terminal it runs in); errors under **error**."
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "fcdb-qs-mssql-note",
|
|
11
|
+
"type": "comment",
|
|
12
|
+
"z": "fcdb-qs-mssql",
|
|
13
|
+
"name": "SQL Server: create → insert → select → clear (see the tab's info)",
|
|
14
|
+
"info": "**What:** creates the table `fromcubes_demo` on deploy, inserts a row, reads the latest ten back and clears the table — on SQL Server.\n\n**How:**\n\nStart a local server:\n\n docker run -d --platform linux/amd64 --name fromcubes-mssql -p 1433:1433 -e ACCEPT_EULA=Y -e 'MSSQL_SA_PASSWORD=Str0ng!Passw0rd' mcr.microsoft.com/mssql/server:2025-latest\n\nOpen the **SQL Server quick start** connection and enter user `sa`, password `Str0ng!Passw0rd` — an example cannot carry credentials.\n\n**Trust server certificate** is on for the self-signed certificate of a local container. Turn it off for a real server.\n\nDeploy, then press the buttons. Both parameters declare their column's type, so `reading: \"abc\"` is refused before it reaches the database.\n\n**Expected:** each result in the Debug sidebar and in the Node-RED log (the terminal it runs in); errors under **error**.",
|
|
15
|
+
"x": 260,
|
|
16
|
+
"y": 40,
|
|
17
|
+
"wires": []
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "fcdb-qs-mssql-on-deploy",
|
|
21
|
+
"type": "inject",
|
|
22
|
+
"z": "fcdb-qs-mssql",
|
|
23
|
+
"name": "on deploy",
|
|
24
|
+
"props": [
|
|
25
|
+
{
|
|
26
|
+
"p": "payload"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"repeat": "",
|
|
30
|
+
"crontab": "",
|
|
31
|
+
"once": true,
|
|
32
|
+
"onceDelay": "1",
|
|
33
|
+
"topic": "",
|
|
34
|
+
"payload": "",
|
|
35
|
+
"payloadType": "date",
|
|
36
|
+
"x": 140,
|
|
37
|
+
"y": 100,
|
|
38
|
+
"wires": [
|
|
39
|
+
[
|
|
40
|
+
"fcdb-qs-mssql-create"
|
|
41
|
+
]
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "fcdb-qs-mssql-create",
|
|
46
|
+
"type": "fromcubes-db-query",
|
|
47
|
+
"z": "fcdb-qs-mssql",
|
|
48
|
+
"name": "create table",
|
|
49
|
+
"connection": "fcdb-qs-mssql-conn",
|
|
50
|
+
"sql": "IF OBJECT_ID('fromcubes_demo') IS NULL\n CREATE TABLE fromcubes_demo (\n id BIGINT IDENTITY PRIMARY KEY,\n note NVARCHAR(200) NOT NULL,\n reading FLOAT,\n created_at DATETIME2(3) NOT NULL DEFAULT SYSUTCDATETIME()\n )",
|
|
51
|
+
"params": [],
|
|
52
|
+
"output": "count",
|
|
53
|
+
"target": "payload",
|
|
54
|
+
"timeoutMs": "",
|
|
55
|
+
"x": 340,
|
|
56
|
+
"y": 100,
|
|
57
|
+
"wires": [
|
|
58
|
+
[
|
|
59
|
+
"fcdb-qs-mssql-debug"
|
|
60
|
+
]
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "fcdb-qs-mssql-go",
|
|
65
|
+
"type": "inject",
|
|
66
|
+
"z": "fcdb-qs-mssql",
|
|
67
|
+
"name": "insert a row",
|
|
68
|
+
"props": [
|
|
69
|
+
{
|
|
70
|
+
"p": "payload"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"repeat": "",
|
|
74
|
+
"crontab": "",
|
|
75
|
+
"once": false,
|
|
76
|
+
"onceDelay": "0.1",
|
|
77
|
+
"topic": "",
|
|
78
|
+
"payload": "{\"note\":\"hello\",\"reading\":21.5}",
|
|
79
|
+
"payloadType": "json",
|
|
80
|
+
"x": 150,
|
|
81
|
+
"y": 160,
|
|
82
|
+
"wires": [
|
|
83
|
+
[
|
|
84
|
+
"fcdb-qs-mssql-insert"
|
|
85
|
+
]
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "fcdb-qs-mssql-insert",
|
|
90
|
+
"type": "fromcubes-db-query",
|
|
91
|
+
"z": "fcdb-qs-mssql",
|
|
92
|
+
"name": "insert",
|
|
93
|
+
"connection": "fcdb-qs-mssql-conn",
|
|
94
|
+
"sql": "INSERT INTO fromcubes_demo (note, reading)\nVALUES (:note, :reading)",
|
|
95
|
+
"params": [
|
|
96
|
+
{
|
|
97
|
+
"name": "note",
|
|
98
|
+
"type": "msg",
|
|
99
|
+
"value": "payload.note",
|
|
100
|
+
"as": "nvarchar",
|
|
101
|
+
"asArgs": "200"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "reading",
|
|
105
|
+
"type": "msg",
|
|
106
|
+
"value": "payload.reading",
|
|
107
|
+
"as": "float"
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"output": "count",
|
|
111
|
+
"target": "inserted",
|
|
112
|
+
"timeoutMs": "",
|
|
113
|
+
"x": 340,
|
|
114
|
+
"y": 160,
|
|
115
|
+
"wires": [
|
|
116
|
+
[
|
|
117
|
+
"fcdb-qs-mssql-select"
|
|
118
|
+
]
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"id": "fcdb-qs-mssql-read",
|
|
123
|
+
"type": "inject",
|
|
124
|
+
"z": "fcdb-qs-mssql",
|
|
125
|
+
"name": "read",
|
|
126
|
+
"props": [
|
|
127
|
+
{
|
|
128
|
+
"p": "payload"
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"repeat": "",
|
|
132
|
+
"crontab": "",
|
|
133
|
+
"once": false,
|
|
134
|
+
"onceDelay": "0.1",
|
|
135
|
+
"topic": "",
|
|
136
|
+
"payload": "",
|
|
137
|
+
"payloadType": "date",
|
|
138
|
+
"x": 130,
|
|
139
|
+
"y": 220,
|
|
140
|
+
"wires": [
|
|
141
|
+
[
|
|
142
|
+
"fcdb-qs-mssql-select"
|
|
143
|
+
]
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"id": "fcdb-qs-mssql-select",
|
|
148
|
+
"type": "fromcubes-db-query",
|
|
149
|
+
"z": "fcdb-qs-mssql",
|
|
150
|
+
"name": "latest 10",
|
|
151
|
+
"connection": "fcdb-qs-mssql-conn",
|
|
152
|
+
"sql": "SELECT TOP (10) id, note, reading, created_at\nFROM fromcubes_demo\nORDER BY id DESC",
|
|
153
|
+
"params": [],
|
|
154
|
+
"output": "rows",
|
|
155
|
+
"target": "payload",
|
|
156
|
+
"timeoutMs": "",
|
|
157
|
+
"x": 540,
|
|
158
|
+
"y": 190,
|
|
159
|
+
"wires": [
|
|
160
|
+
[
|
|
161
|
+
"fcdb-qs-mssql-debug"
|
|
162
|
+
]
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"id": "fcdb-qs-mssql-wipe",
|
|
167
|
+
"type": "inject",
|
|
168
|
+
"z": "fcdb-qs-mssql",
|
|
169
|
+
"name": "clear",
|
|
170
|
+
"props": [
|
|
171
|
+
{
|
|
172
|
+
"p": "payload"
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
"repeat": "",
|
|
176
|
+
"crontab": "",
|
|
177
|
+
"once": false,
|
|
178
|
+
"onceDelay": "0.1",
|
|
179
|
+
"topic": "",
|
|
180
|
+
"payload": "",
|
|
181
|
+
"payloadType": "date",
|
|
182
|
+
"x": 130,
|
|
183
|
+
"y": 280,
|
|
184
|
+
"wires": [
|
|
185
|
+
[
|
|
186
|
+
"fcdb-qs-mssql-clear"
|
|
187
|
+
]
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"id": "fcdb-qs-mssql-clear",
|
|
192
|
+
"type": "fromcubes-db-query",
|
|
193
|
+
"z": "fcdb-qs-mssql",
|
|
194
|
+
"name": "clear table",
|
|
195
|
+
"connection": "fcdb-qs-mssql-conn",
|
|
196
|
+
"sql": "DELETE FROM fromcubes_demo",
|
|
197
|
+
"params": [],
|
|
198
|
+
"output": "count",
|
|
199
|
+
"target": "payload",
|
|
200
|
+
"timeoutMs": "",
|
|
201
|
+
"x": 340,
|
|
202
|
+
"y": 280,
|
|
203
|
+
"wires": [
|
|
204
|
+
[
|
|
205
|
+
"fcdb-qs-mssql-debug"
|
|
206
|
+
]
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"id": "fcdb-qs-mssql-debug",
|
|
211
|
+
"type": "debug",
|
|
212
|
+
"z": "fcdb-qs-mssql",
|
|
213
|
+
"name": "SQL Server",
|
|
214
|
+
"active": true,
|
|
215
|
+
"tosidebar": true,
|
|
216
|
+
"console": true,
|
|
217
|
+
"tostatus": true,
|
|
218
|
+
"complete": "payload",
|
|
219
|
+
"targetType": "msg",
|
|
220
|
+
"statusVal": "payload",
|
|
221
|
+
"statusType": "auto",
|
|
222
|
+
"x": 760,
|
|
223
|
+
"y": 190,
|
|
224
|
+
"wires": []
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"id": "fcdb-qs-mssql-catch",
|
|
228
|
+
"type": "catch",
|
|
229
|
+
"z": "fcdb-qs-mssql",
|
|
230
|
+
"name": "database errors",
|
|
231
|
+
"scope": null,
|
|
232
|
+
"uncaught": false,
|
|
233
|
+
"x": 140,
|
|
234
|
+
"y": 340,
|
|
235
|
+
"wires": [
|
|
236
|
+
[
|
|
237
|
+
"fcdb-qs-mssql-error"
|
|
238
|
+
]
|
|
239
|
+
]
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"id": "fcdb-qs-mssql-error",
|
|
243
|
+
"type": "debug",
|
|
244
|
+
"z": "fcdb-qs-mssql",
|
|
245
|
+
"name": "error",
|
|
246
|
+
"active": true,
|
|
247
|
+
"tosidebar": true,
|
|
248
|
+
"console": true,
|
|
249
|
+
"tostatus": false,
|
|
250
|
+
"complete": "true",
|
|
251
|
+
"targetType": "full",
|
|
252
|
+
"statusVal": "",
|
|
253
|
+
"statusType": "auto",
|
|
254
|
+
"x": 340,
|
|
255
|
+
"y": 340,
|
|
256
|
+
"wires": []
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"id": "fcdb-qs-mssql-conn",
|
|
260
|
+
"type": "fromcubes-db-connection",
|
|
261
|
+
"name": "SQL Server quick start",
|
|
262
|
+
"dialect": "mssql",
|
|
263
|
+
"userSource": "cred",
|
|
264
|
+
"passwordSource": "cred",
|
|
265
|
+
"poolMin": 0,
|
|
266
|
+
"poolMax": 10,
|
|
267
|
+
"idleTimeoutMs": 30000,
|
|
268
|
+
"connectTimeoutMs": 15000,
|
|
269
|
+
"queryTimeoutMs": 30000,
|
|
270
|
+
"queueMax": 100,
|
|
271
|
+
"undefinedAsNull": false,
|
|
272
|
+
"options": "",
|
|
273
|
+
"host": "localhost",
|
|
274
|
+
"port": 1433,
|
|
275
|
+
"database": "master",
|
|
276
|
+
"msEncrypt": true,
|
|
277
|
+
"msTrustCert": true,
|
|
278
|
+
"msInstance": "",
|
|
279
|
+
"msDomain": "",
|
|
280
|
+
"appName": ""
|
|
281
|
+
}
|
|
282
|
+
]
|