@aaqu/fromcubes-db 0.0.0-stage → 0.1.0
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,278 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "fcdb-qs-sqlite",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "SQLite 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 SQLite.\n\n**How:**\n\nNothing to start: SQLite is a file, `quick-start`, in Node-RED's user directory.\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-sqlite-note",
|
|
11
|
+
"type": "comment",
|
|
12
|
+
"z": "fcdb-qs-sqlite",
|
|
13
|
+
"name": "SQLite: 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 SQLite.\n\n**How:**\n\nNothing to start: SQLite is a file, `quick-start`, in Node-RED's user directory.\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-sqlite-on-deploy",
|
|
21
|
+
"type": "inject",
|
|
22
|
+
"z": "fcdb-qs-sqlite",
|
|
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-sqlite-create"
|
|
41
|
+
]
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "fcdb-qs-sqlite-create",
|
|
46
|
+
"type": "fromcubes-db-query",
|
|
47
|
+
"z": "fcdb-qs-sqlite",
|
|
48
|
+
"name": "create table",
|
|
49
|
+
"connection": "fcdb-qs-sqlite-conn",
|
|
50
|
+
"sql": "CREATE TABLE IF NOT EXISTS fromcubes_demo (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n note TEXT NOT NULL,\n reading REAL,\n created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))\n)",
|
|
51
|
+
"params": [],
|
|
52
|
+
"output": "count",
|
|
53
|
+
"target": "payload",
|
|
54
|
+
"timeoutMs": "",
|
|
55
|
+
"x": 340,
|
|
56
|
+
"y": 100,
|
|
57
|
+
"wires": [
|
|
58
|
+
[
|
|
59
|
+
"fcdb-qs-sqlite-debug"
|
|
60
|
+
]
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "fcdb-qs-sqlite-go",
|
|
65
|
+
"type": "inject",
|
|
66
|
+
"z": "fcdb-qs-sqlite",
|
|
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-sqlite-insert"
|
|
85
|
+
]
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "fcdb-qs-sqlite-insert",
|
|
90
|
+
"type": "fromcubes-db-query",
|
|
91
|
+
"z": "fcdb-qs-sqlite",
|
|
92
|
+
"name": "insert",
|
|
93
|
+
"connection": "fcdb-qs-sqlite-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": "real"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"output": "count",
|
|
110
|
+
"target": "inserted",
|
|
111
|
+
"timeoutMs": "",
|
|
112
|
+
"x": 340,
|
|
113
|
+
"y": 160,
|
|
114
|
+
"wires": [
|
|
115
|
+
[
|
|
116
|
+
"fcdb-qs-sqlite-select"
|
|
117
|
+
]
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"id": "fcdb-qs-sqlite-read",
|
|
122
|
+
"type": "inject",
|
|
123
|
+
"z": "fcdb-qs-sqlite",
|
|
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-sqlite-select"
|
|
142
|
+
]
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"id": "fcdb-qs-sqlite-select",
|
|
147
|
+
"type": "fromcubes-db-query",
|
|
148
|
+
"z": "fcdb-qs-sqlite",
|
|
149
|
+
"name": "latest 10",
|
|
150
|
+
"connection": "fcdb-qs-sqlite-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-sqlite-debug"
|
|
161
|
+
]
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"id": "fcdb-qs-sqlite-wipe",
|
|
166
|
+
"type": "inject",
|
|
167
|
+
"z": "fcdb-qs-sqlite",
|
|
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-sqlite-clear"
|
|
186
|
+
]
|
|
187
|
+
]
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"id": "fcdb-qs-sqlite-clear",
|
|
191
|
+
"type": "fromcubes-db-query",
|
|
192
|
+
"z": "fcdb-qs-sqlite",
|
|
193
|
+
"name": "clear table",
|
|
194
|
+
"connection": "fcdb-qs-sqlite-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-sqlite-debug"
|
|
205
|
+
]
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"id": "fcdb-qs-sqlite-debug",
|
|
210
|
+
"type": "debug",
|
|
211
|
+
"z": "fcdb-qs-sqlite",
|
|
212
|
+
"name": "SQLite",
|
|
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-sqlite-catch",
|
|
227
|
+
"type": "catch",
|
|
228
|
+
"z": "fcdb-qs-sqlite",
|
|
229
|
+
"name": "database errors",
|
|
230
|
+
"scope": null,
|
|
231
|
+
"uncaught": false,
|
|
232
|
+
"x": 140,
|
|
233
|
+
"y": 340,
|
|
234
|
+
"wires": [
|
|
235
|
+
[
|
|
236
|
+
"fcdb-qs-sqlite-error"
|
|
237
|
+
]
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"id": "fcdb-qs-sqlite-error",
|
|
242
|
+
"type": "debug",
|
|
243
|
+
"z": "fcdb-qs-sqlite",
|
|
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-sqlite-conn",
|
|
259
|
+
"type": "fromcubes-db-connection",
|
|
260
|
+
"name": "SQLite quick start",
|
|
261
|
+
"dialect": "sqlite",
|
|
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
|
+
"sqliteFile": "quick-start",
|
|
273
|
+
"sqliteReadOnly": false,
|
|
274
|
+
"sqliteWal": true,
|
|
275
|
+
"sqliteForeignKeys": true,
|
|
276
|
+
"sqliteBusyTimeoutMs": 5000
|
|
277
|
+
}
|
|
278
|
+
]
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "fcdb-qs-tidb",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "TiDB 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 TiDB.\n\n**How:**\n\nStart a local server:\n\n docker run -d --name fromcubes-tidb -p 4000:4000 pingcap/tidb:v8.5.8\n\nOpen the **TiDB quick start** connection and enter user `root`, no password — 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-tidb-note",
|
|
11
|
+
"type": "comment",
|
|
12
|
+
"z": "fcdb-qs-tidb",
|
|
13
|
+
"name": "TiDB: 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 TiDB.\n\n**How:**\n\nStart a local server:\n\n docker run -d --name fromcubes-tidb -p 4000:4000 pingcap/tidb:v8.5.8\n\nOpen the **TiDB quick start** connection and enter user `root`, no password — 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-tidb-on-deploy",
|
|
21
|
+
"type": "inject",
|
|
22
|
+
"z": "fcdb-qs-tidb",
|
|
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-tidb-create"
|
|
41
|
+
]
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "fcdb-qs-tidb-create",
|
|
46
|
+
"type": "fromcubes-db-query",
|
|
47
|
+
"z": "fcdb-qs-tidb",
|
|
48
|
+
"name": "create table",
|
|
49
|
+
"connection": "fcdb-qs-tidb-conn",
|
|
50
|
+
"sql": "CREATE TABLE IF NOT EXISTS fromcubes_demo (\n id BIGINT AUTO_INCREMENT PRIMARY KEY,\n note VARCHAR(200) NOT NULL,\n reading DOUBLE,\n created_at TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)\n)",
|
|
51
|
+
"params": [],
|
|
52
|
+
"output": "count",
|
|
53
|
+
"target": "payload",
|
|
54
|
+
"timeoutMs": "",
|
|
55
|
+
"x": 340,
|
|
56
|
+
"y": 100,
|
|
57
|
+
"wires": [
|
|
58
|
+
[
|
|
59
|
+
"fcdb-qs-tidb-debug"
|
|
60
|
+
]
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "fcdb-qs-tidb-go",
|
|
65
|
+
"type": "inject",
|
|
66
|
+
"z": "fcdb-qs-tidb",
|
|
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-tidb-insert"
|
|
85
|
+
]
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "fcdb-qs-tidb-insert",
|
|
90
|
+
"type": "fromcubes-db-query",
|
|
91
|
+
"z": "fcdb-qs-tidb",
|
|
92
|
+
"name": "insert",
|
|
93
|
+
"connection": "fcdb-qs-tidb-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": "varchar",
|
|
101
|
+
"asArgs": "200"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "reading",
|
|
105
|
+
"type": "msg",
|
|
106
|
+
"value": "payload.reading",
|
|
107
|
+
"as": "double"
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"output": "count",
|
|
111
|
+
"target": "inserted",
|
|
112
|
+
"timeoutMs": "",
|
|
113
|
+
"x": 340,
|
|
114
|
+
"y": 160,
|
|
115
|
+
"wires": [
|
|
116
|
+
[
|
|
117
|
+
"fcdb-qs-tidb-select"
|
|
118
|
+
]
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"id": "fcdb-qs-tidb-read",
|
|
123
|
+
"type": "inject",
|
|
124
|
+
"z": "fcdb-qs-tidb",
|
|
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-tidb-select"
|
|
143
|
+
]
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"id": "fcdb-qs-tidb-select",
|
|
148
|
+
"type": "fromcubes-db-query",
|
|
149
|
+
"z": "fcdb-qs-tidb",
|
|
150
|
+
"name": "latest 10",
|
|
151
|
+
"connection": "fcdb-qs-tidb-conn",
|
|
152
|
+
"sql": "SELECT id, note, reading, created_at\nFROM fromcubes_demo\nORDER BY id DESC\nLIMIT 10",
|
|
153
|
+
"params": [],
|
|
154
|
+
"output": "rows",
|
|
155
|
+
"target": "payload",
|
|
156
|
+
"timeoutMs": "",
|
|
157
|
+
"x": 540,
|
|
158
|
+
"y": 190,
|
|
159
|
+
"wires": [
|
|
160
|
+
[
|
|
161
|
+
"fcdb-qs-tidb-debug"
|
|
162
|
+
]
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"id": "fcdb-qs-tidb-wipe",
|
|
167
|
+
"type": "inject",
|
|
168
|
+
"z": "fcdb-qs-tidb",
|
|
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-tidb-clear"
|
|
187
|
+
]
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"id": "fcdb-qs-tidb-clear",
|
|
192
|
+
"type": "fromcubes-db-query",
|
|
193
|
+
"z": "fcdb-qs-tidb",
|
|
194
|
+
"name": "clear table",
|
|
195
|
+
"connection": "fcdb-qs-tidb-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-tidb-debug"
|
|
206
|
+
]
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"id": "fcdb-qs-tidb-debug",
|
|
211
|
+
"type": "debug",
|
|
212
|
+
"z": "fcdb-qs-tidb",
|
|
213
|
+
"name": "TiDB",
|
|
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-tidb-catch",
|
|
228
|
+
"type": "catch",
|
|
229
|
+
"z": "fcdb-qs-tidb",
|
|
230
|
+
"name": "database errors",
|
|
231
|
+
"scope": null,
|
|
232
|
+
"uncaught": false,
|
|
233
|
+
"x": 140,
|
|
234
|
+
"y": 340,
|
|
235
|
+
"wires": [
|
|
236
|
+
[
|
|
237
|
+
"fcdb-qs-tidb-error"
|
|
238
|
+
]
|
|
239
|
+
]
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"id": "fcdb-qs-tidb-error",
|
|
243
|
+
"type": "debug",
|
|
244
|
+
"z": "fcdb-qs-tidb",
|
|
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-tidb-conn",
|
|
260
|
+
"type": "fromcubes-db-connection",
|
|
261
|
+
"name": "TiDB quick start",
|
|
262
|
+
"dialect": "tidb",
|
|
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": 4000,
|
|
275
|
+
"database": "test",
|
|
276
|
+
"mySsl": false,
|
|
277
|
+
"mySslVerify": true,
|
|
278
|
+
"myCharset": "",
|
|
279
|
+
"myTimezone": ""
|
|
280
|
+
}
|
|
281
|
+
]
|