meadow-connection-postgresql 1.0.3 → 1.0.5
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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connection form schema for PostgreSQL.
|
|
3
|
+
*
|
|
4
|
+
* Consumed by meadow-connection-manager#getProviderFormSchema('PostgreSQL').
|
|
5
|
+
* Pure data — safe to require() even when the pg driver is not installed.
|
|
6
|
+
* See Meadow-Connection-MySQL-FormSchema.js for the full field contract.
|
|
7
|
+
*/
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
module.exports =
|
|
11
|
+
{
|
|
12
|
+
Provider: 'PostgreSQL',
|
|
13
|
+
DisplayName: 'PostgreSQL',
|
|
14
|
+
Description: 'Connect to a PostgreSQL server.',
|
|
15
|
+
Fields:
|
|
16
|
+
[
|
|
17
|
+
{ Name: 'host', Label: 'Host', Type: 'String', Default: '127.0.0.1', Required: true, Placeholder: '127.0.0.1' },
|
|
18
|
+
{ Name: 'port', Label: 'Port', Type: 'Number', Default: 5432, Required: true, Min: 1, Max: 65535 },
|
|
19
|
+
{ Name: 'user', Label: 'User', Type: 'String', Default: 'postgres', Required: true },
|
|
20
|
+
{ Name: 'password', Label: 'Password', Type: 'Password' },
|
|
21
|
+
{ Name: 'database', Label: 'Database', Type: 'String', Placeholder: 'meadow_clone' },
|
|
22
|
+
{ Name: 'max', Label: 'Connection Pool Limit', Type: 'Number', Default: 10, Min: 1, Group: 'Advanced' }
|
|
23
|
+
]
|
|
24
|
+
};
|
|
@@ -64,11 +64,15 @@ class MeadowSchemaPostgreSQL extends libFableServiceProviderBase
|
|
|
64
64
|
tmpPrimaryKey = tmpColumn.Column;
|
|
65
65
|
break;
|
|
66
66
|
case 'GUID':
|
|
67
|
-
|
|
67
|
+
// Default GUID column width is 255 — UUIDs need 36 but
|
|
68
|
+
// composite GUIDs from integration adapters (meadow-
|
|
69
|
+
// integration's prefix + entity + external GUID) often
|
|
70
|
+
// exceed 36. Wider default avoids silent truncation
|
|
71
|
+
// when the descriptor doesn't pin a Size.
|
|
72
|
+
let tmpSize = tmpColumn.hasOwnProperty('Size') ? tmpColumn.Size : 255;
|
|
68
73
|
if (isNaN(tmpSize))
|
|
69
74
|
{
|
|
70
|
-
|
|
71
|
-
tmpSize = 36;
|
|
75
|
+
tmpSize = 255;
|
|
72
76
|
}
|
|
73
77
|
tmpCreateTableStatement += ` "${tmpColumn.Column}" VARCHAR(${tmpSize}) DEFAULT '0xDe'`;
|
|
74
78
|
break;
|