meadow 2.0.12 → 2.0.14

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",
3
- "version": "2.0.12",
3
+ "version": "2.0.14",
4
4
  "description": "A data access library.",
5
5
  "main": "source/Meadow.js",
6
6
  "scripts": {
@@ -65,14 +65,19 @@ var MeadowProvider = function ()
65
65
  let tmpParameterType = pQuery.query.parameterTypes[tmpParameterTypeKeys[i]];
66
66
  if (_Fable.MeadowMSSQLProvider.MSSQL[tmpParameterType] === undefined)
67
67
  {
68
- tmpParameterType = 'Char';
68
+ tmpParameterType = 'VarChar';
69
69
  }
70
70
  // TODO: Decide how to filter better cleansing to this layer from the schema; we have access to proper lengths.
71
71
  // BEFORE WE ADD THIS BEHAVIOR, DECIDE CONCISTENCY WITH OTHER PROVIDERS WHO ALLOW OVERFLOWING STRINGS
72
72
  let tmpParameterEntry = false;
73
73
  if ((tmpParameterType === 'Char') || (tmpParameterType === 'VarChar'))
74
74
  {
75
- tmpParameterEntry = _Fable.MeadowMSSQLProvider.MSSQL[tmpParameterType](64);
75
+ tmpParameterEntry = _Fable.MeadowMSSQLProvider.MSSQL[tmpParameterType](_Fable.MeadowMSSQLProvider.MSSQL.Max);
76
+ }
77
+ // TODO: There is a bug with Text and schemata in ArtifactTypes at least.
78
+ else if (tmpParameterType === 'Text')
79
+ {
80
+ tmpParameterEntry = _Fable.MeadowMSSQLProvider.MSSQL.VarChar(_Fable.MeadowMSSQLProvider.MSSQL.Max);
76
81
  }
77
82
  else
78
83
  {
@@ -98,7 +103,12 @@ var MeadowProvider = function ()
98
103
 
99
104
  let tmpPreparedStatement = getPreparedStatementFromQuery(pQuery);
100
105
 
101
- let tmpQueryBody = `${pQuery.query.body} \nSELECT @@IDENTITY AS value;`
106
+ let tmpQueryBody = `${pQuery.query.body} \nSELECT SCOPE_IDENTITY() AS value;`
107
+
108
+ if (pQuery.AllowIdentityInsert)
109
+ {
110
+ tmpQueryBody = `SET IDENTITY_INSERT [${pQuery.parameters.scope}] ON; \n${tmpQueryBody} \nSET IDENTITY_INSERT [${pQuery.parameters.scope}] OFF;`
111
+ }
102
112
 
103
113
  tmpPreparedStatement.prepare(tmpQueryBody,
104
114
  (pPrepareError) =>