meadow-integration 1.0.32 → 1.0.33

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-integration",
3
- "version": "1.0.32",
3
+ "version": "1.0.33",
4
4
  "description": "Meadow Data Integration",
5
5
  "bin": {
6
6
  "mdwint": "source/cli/Meadow-Integration-CLI-Run.js"
@@ -43,15 +43,15 @@
43
43
  "fable": "^3.1.70",
44
44
  "fable-serviceproviderbase": "^3.0.19",
45
45
  "fast-xml-parser": "^4.4.1",
46
- "meadow": "^2.0.33",
47
- "meadow-connection-mssql": "^1.0.16",
48
- "meadow-connection-mysql": "^1.0.14",
46
+ "meadow": "^2.0.35",
47
+ "meadow-connection-mssql": "^1.0.19",
48
+ "meadow-connection-mysql": "^1.0.17",
49
49
  "orator": "^6.0.4",
50
50
  "orator-serviceserver-restify": "^2.0.10",
51
51
  "pict-section-flow": "^0.0.17",
52
52
  "pict-service-commandlineutility": "^1.0.19",
53
53
  "pict-sessionmanager": "^1.0.2",
54
- "pict-view": "^1.0.67",
54
+ "pict-view": "^1.0.68",
55
55
  "xlsx": "^0.18.5"
56
56
  }
57
57
  }
@@ -86,18 +86,32 @@ class MeadowSyncEntityInitial extends libFableServiceProviderBase
86
86
  this.log.warn(`${this.EntitySchema.TableName}: createTable returned error: ${pCreateError}`);
87
87
  }
88
88
 
89
+ // Sync-entity init intentionally does not create indexes here.
90
+ // In the DataCloner flow there is no MeadowConnectionManager
91
+ // service registered, so the legacy createIndex path was dead
92
+ // code that just logged noise ("No connection manager
93
+ // available; skipping index creation for X") for every table.
94
+ // Indexes are created via the provider's own createIndices /
95
+ // generateCreateIndexStatements methods, invoked by the
96
+ // DataCloner's dedicated /indices/create endpoint after the
97
+ // initial sync is complete — that's the point where it makes
98
+ // sense to build indexes, since they're expensive on populated
99
+ // tables.
100
+ //
101
+ // Preserve the legacy MeadowConnectionManager path for the CLI
102
+ // Meadow-Integration-Command-DataClone.js flow (which does
103
+ // register that service), but do it silently when neither
104
+ // indexable column nor connection manager is available.
89
105
  const tmpGUIDColumn = this.EntitySchema.Columns.find((c) => c.DataType == 'GUID');
90
106
  const tmpDeletedColumn = this.EntitySchema.Columns.find((c) => c.Column == 'Deleted');
91
107
 
92
- if (!tmpGUIDColumn && !tmpDeletedColumn)
93
- {
94
- this.log.info(`No GUID or Deleted columns for ${this.EntitySchema.TableName}; skipping index creation`);
95
- return fCallback(pCreateError);
96
- }
108
+ let tmpCanCreateIndexes = (tmpGUIDColumn || tmpDeletedColumn)
109
+ && this.fable.MeadowConnectionManager
110
+ && this.fable.MeadowConnectionManager.ConnectionPool
111
+ && typeof(this.fable.MeadowConnectionManager.createIndex) === 'function';
97
112
 
98
- if (!this.fable.MeadowConnectionManager || !this.fable.MeadowConnectionManager.ConnectionPool)
113
+ if (!tmpCanCreateIndexes)
99
114
  {
100
- this.log.info(`No connection manager available; skipping index creation for ${this.EntitySchema.TableName}`);
101
115
  return fCallback(pCreateError);
102
116
  }
103
117
 
@@ -80,19 +80,23 @@ class MeadowSyncEntityOngoing extends libFableServiceProviderBase
80
80
  {
81
81
  return this.Meadow.provider.getProvider().createTable(this.EntitySchema, (pCreateError) =>
82
82
  {
83
-
83
+ // Sync-entity init intentionally does not create indexes here
84
+ // in the DataCloner flow. See the comment in
85
+ // Meadow-Service-Sync-Entity-Initial.js for the rationale —
86
+ // indexes go through the provider's createIndices path
87
+ // (triggered by DataCloner's /indices/create endpoint) rather
88
+ // than via MeadowConnectionManager, which isn't registered in
89
+ // the DataCloner service container.
84
90
  const tmpGUIDColumn = this.EntitySchema.Columns.find((c) => c.DataType == 'GUID');
85
91
  const tmpDeletedColumn = this.EntitySchema.Columns.find((c) => c.Column == 'Deleted');
86
92
 
87
- if (!tmpGUIDColumn && !tmpDeletedColumn)
88
- {
89
- this.log.info(`No GUID or Deleted columns for ${this.EntitySchema.TableName}; skipping index creation`);
90
- return fCallback(pCreateError);
91
- }
93
+ let tmpCanCreateIndexes = (tmpGUIDColumn || tmpDeletedColumn)
94
+ && this.fable.MeadowConnectionManager
95
+ && this.fable.MeadowConnectionManager.ConnectionPool
96
+ && typeof(this.fable.MeadowConnectionManager.createIndex) === 'function';
92
97
 
93
- if (!this.fable.MeadowConnectionManager || !this.fable.MeadowConnectionManager.ConnectionPool)
98
+ if (!tmpCanCreateIndexes)
94
99
  {
95
- this.log.info(`No connection manager available; skipping index creation for ${this.EntitySchema.TableName}`);
96
100
  return fCallback(pCreateError);
97
101
  }
98
102