meadow 2.0.11 → 2.0.13
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 +1 -1
- package/source/providers/Meadow-Provider-ALASQL.js +3 -0
- package/source/providers/Meadow-Provider-MSSQL.js +20 -4
- package/source/providers/Meadow-Provider-MeadowEndpoints.js +3 -0
- package/source/providers/Meadow-Provider-MySQL.js +20 -1
- package/source/providers/Meadow-Provider-None.js +3 -0
package/package.json
CHANGED
|
@@ -31,10 +31,18 @@ var MeadowProvider = function ()
|
|
|
31
31
|
{
|
|
32
32
|
return _Fable.MeadowMSSQLProvider.pool;
|
|
33
33
|
}
|
|
34
|
-
|
|
35
34
|
return false;
|
|
36
35
|
};
|
|
37
36
|
|
|
37
|
+
var getProvider = function ()
|
|
38
|
+
{
|
|
39
|
+
if (typeof (_Fable.MeadowMSSQLProvider) == 'object' && _Fable.MeadowMSSQLProvider.connected)
|
|
40
|
+
{
|
|
41
|
+
return _Fable.MeadowMSSQLProvider;
|
|
42
|
+
}
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
|
|
38
46
|
// The Meadow marshaller also passes in the Schema as the third parameter, but this is a blunt function ATM.
|
|
39
47
|
var marshalRecordFromSourceToObject = function (pObject, pRecord)
|
|
40
48
|
{
|
|
@@ -57,14 +65,14 @@ var MeadowProvider = function ()
|
|
|
57
65
|
let tmpParameterType = pQuery.query.parameterTypes[tmpParameterTypeKeys[i]];
|
|
58
66
|
if (_Fable.MeadowMSSQLProvider.MSSQL[tmpParameterType] === undefined)
|
|
59
67
|
{
|
|
60
|
-
tmpParameterType = '
|
|
68
|
+
tmpParameterType = 'VarChar';
|
|
61
69
|
}
|
|
62
70
|
// TODO: Decide how to filter better cleansing to this layer from the schema; we have access to proper lengths.
|
|
63
71
|
// BEFORE WE ADD THIS BEHAVIOR, DECIDE CONCISTENCY WITH OTHER PROVIDERS WHO ALLOW OVERFLOWING STRINGS
|
|
64
72
|
let tmpParameterEntry = false;
|
|
65
73
|
if ((tmpParameterType === 'Char') || (tmpParameterType === 'VarChar'))
|
|
66
74
|
{
|
|
67
|
-
tmpParameterEntry = _Fable.MeadowMSSQLProvider.MSSQL[tmpParameterType](
|
|
75
|
+
tmpParameterEntry = _Fable.MeadowMSSQLProvider.MSSQL[tmpParameterType](255);
|
|
68
76
|
}
|
|
69
77
|
else
|
|
70
78
|
{
|
|
@@ -90,7 +98,12 @@ var MeadowProvider = function ()
|
|
|
90
98
|
|
|
91
99
|
let tmpPreparedStatement = getPreparedStatementFromQuery(pQuery);
|
|
92
100
|
|
|
93
|
-
let tmpQueryBody = `${pQuery.query.body} \nSELECT
|
|
101
|
+
let tmpQueryBody = `${pQuery.query.body} \nSELECT SCOPE_IDENTITY() AS value;`
|
|
102
|
+
|
|
103
|
+
if (pQuery.AllowIdentityInsert)
|
|
104
|
+
{
|
|
105
|
+
tmpQueryBody = `SET IDENTITY_INSERT ${pQuery.parameters.scope} ON; \n${tmpQueryBody} \nSET IDENTITY_INSERT ${pQuery.parameters.scope} OFF;`
|
|
106
|
+
}
|
|
94
107
|
|
|
95
108
|
tmpPreparedStatement.prepare(tmpQueryBody,
|
|
96
109
|
(pPrepareError) =>
|
|
@@ -394,6 +407,9 @@ var MeadowProvider = function ()
|
|
|
394
407
|
Undelete: Undelete,
|
|
395
408
|
Count: Count,
|
|
396
409
|
|
|
410
|
+
getProvider: getProvider,
|
|
411
|
+
providerCreatesSupported: true,
|
|
412
|
+
|
|
397
413
|
new: createNew
|
|
398
414
|
});
|
|
399
415
|
|
|
@@ -25,7 +25,6 @@ var MeadowProvider = function ()
|
|
|
25
25
|
*/
|
|
26
26
|
var getSQLPool = function ()
|
|
27
27
|
{
|
|
28
|
-
let tmpSqlPool = false;
|
|
29
28
|
if (typeof (_Fable.MeadowMySQLConnectionPool) == 'object')
|
|
30
29
|
{
|
|
31
30
|
// This is where the old-style SQL Connection pool is. Refactor doesn't even look for it anymore
|
|
@@ -41,6 +40,23 @@ var MeadowProvider = function ()
|
|
|
41
40
|
return false;
|
|
42
41
|
};
|
|
43
42
|
|
|
43
|
+
var getProvider = function ()
|
|
44
|
+
{
|
|
45
|
+
if (typeof (_Fable.MeadowMySQLConnectionPool) == 'object')
|
|
46
|
+
{
|
|
47
|
+
// This is where the old-style SQL Connection pool is. Refactor doesn't even look for it anymore
|
|
48
|
+
return _Fable.MeadowMySQLConnectionPool;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// New-style default connection pool provider
|
|
52
|
+
if (typeof (_Fable.MeadowMySQLProvider) == 'object')
|
|
53
|
+
{
|
|
54
|
+
return _Fable.MeadowMySQLProvider;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
|
|
44
60
|
// The Meadow marshaller also passes in the Schema as the third parameter, but this is a blunt function ATM.
|
|
45
61
|
var marshalRecordFromSourceToObject = function (pObject, pRecord)
|
|
46
62
|
{
|
|
@@ -281,6 +297,9 @@ var MeadowProvider = function ()
|
|
|
281
297
|
Undelete: Undelete,
|
|
282
298
|
Count: Count,
|
|
283
299
|
|
|
300
|
+
getProvider: getProvider,
|
|
301
|
+
providerCreatesSupported: false,
|
|
302
|
+
|
|
284
303
|
new: createNew
|
|
285
304
|
});
|
|
286
305
|
|