meadow-connection-mysql 1.0.17 → 1.0.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meadow-connection-mysql",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "Meadow MySQL Plugin",
5
5
  "main": "source/Meadow-Connection-MySQL.js",
6
6
  "scripts": {
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Connection form schema for MySQL.
3
+ *
4
+ * Consumed by:
5
+ * meadow-connection-manager#getProviderFormSchema('MySQL')
6
+ * ...and any UI that wants to render a "connect to MySQL" form without
7
+ * re-encoding the field list. Pure data — safe to require() even when
8
+ * the underlying mysql2 driver is not installed.
9
+ *
10
+ * Field shape (see meadow-connection-manager docs for the full contract):
11
+ * Name — canonical config key the connection module reads
12
+ * Label — UI label
13
+ * Type — String | Number | Password | Boolean | Path | Select
14
+ * Default — initial value
15
+ * Required — boolean (default false)
16
+ * Placeholder — input placeholder
17
+ * Help — tooltip / hint
18
+ * Min, Max — Number bounds
19
+ * Group — 'Basic' (default) or 'Advanced' (collapsible)
20
+ * Multiplier — form value × multiplier = stored value (sec→ms via 1000)
21
+ * MapTo — alternate dotted-path target(s); if absent, stored at Name
22
+ * OmitIfFalsy — drop the key from the emitted config when the value is
23
+ * 0/empty/false (matches DataCloner's `if (x > 0)` pattern)
24
+ */
25
+ 'use strict';
26
+
27
+ module.exports =
28
+ {
29
+ Provider: 'MySQL',
30
+ DisplayName: 'MySQL',
31
+ Description: 'Connect to a MySQL or MariaDB server.',
32
+ Fields:
33
+ [
34
+ { Name: 'host', Label: 'Server', Type: 'String', Default: '127.0.0.1', Required: true, Placeholder: '127.0.0.1' },
35
+ { Name: 'port', Label: 'Port', Type: 'Number', Default: 3306, Required: true, Min: 1, Max: 65535 },
36
+ { Name: 'user', Label: 'User', Type: 'String', Default: 'root', Required: true },
37
+ { Name: 'password', Label: 'Password', Type: 'Password' },
38
+ { Name: 'database', Label: 'Database', Type: 'String', Placeholder: 'meadow' },
39
+ { Name: 'connectionLimit', Label: 'Connection Limit', Type: 'Number', Default: 20, Min: 1, Group: 'Advanced' }
40
+ ]
41
+ };
@@ -64,11 +64,13 @@ class MeadowSchemaMySQL extends libFableServiceProviderBase
64
64
  tmpPrimaryKey = tmpColumn.Column;
65
65
  break;
66
66
  case 'GUID':
67
- let tmpSize = tmpColumn.hasOwnProperty('Size') ? tmpColumn.Size : 36;
67
+ // Default GUID column width is 255 — UUIDs need 36 but
68
+ // composite GUIDs from integration adapters often exceed
69
+ // that. Wider default avoids silent truncation.
70
+ let tmpSize = tmpColumn.hasOwnProperty('Size') ? tmpColumn.Size : 255;
68
71
  if (isNaN(tmpSize))
69
72
  {
70
- // Use the old default if Size is improper
71
- tmpSize = 36;
73
+ tmpSize = 255;
72
74
  }
73
75
  tmpCreateTableStatement += ` ${tmpColumn.Column} CHAR(${tmpSize}) DEFAULT '0xDe'`;
74
76
  break;