retold-data-service 2.0.19 → 2.0.20

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": "retold-data-service",
3
- "version": "2.0.19",
3
+ "version": "2.0.20",
4
4
  "description": "Serve up a whole model!",
5
5
  "main": "source/Retold-Data-Service.js",
6
6
  "bin": {
@@ -64,6 +64,16 @@ module.exports = (pDataClonerService, pOratorServiceServer) =>
64
64
  }
65
65
  }
66
66
 
67
+ // Update UseAdvancedIDPagination on all sync entities
68
+ if (tmpBody.hasOwnProperty('UseAdvancedIDPagination'))
69
+ {
70
+ let tmpEntityNames = Object.keys(tmpFable.MeadowSync.MeadowSyncEntities);
71
+ for (let i = 0; i < tmpEntityNames.length; i++)
72
+ {
73
+ tmpFable.MeadowSync.MeadowSyncEntities[tmpEntityNames[i]].UseAdvancedIDPagination = !!tmpBody.UseAdvancedIDPagination;
74
+ }
75
+ }
76
+
67
77
  // Update DateTimePrecisionMS on MeadowSync and all sync entities
68
78
  if (tmpBody.hasOwnProperty('DateTimePrecisionMS'))
69
79
  {
@@ -173,7 +183,7 @@ module.exports = (pDataClonerService, pOratorServiceServer) =>
173
183
  let tmpReinitEntities = Object.keys(tmpFable.MeadowSync.MeadowSyncEntities);
174
184
  tmpFable.log.info(`Data Cloner: Re-created ${tmpReinitEntities.length} sync entities in ${tmpRequestedMode} mode`);
175
185
 
176
- // Update SyncDeletedRecords and MaxRecordsPerEntity on new entities
186
+ // Update SyncDeletedRecords, MaxRecordsPerEntity, and UseAdvancedIDPagination on new entities
177
187
  for (let i = 0; i < tmpReinitEntities.length; i++)
178
188
  {
179
189
  tmpFable.MeadowSync.MeadowSyncEntities[tmpReinitEntities[i]].SyncDeletedRecords = tmpCloneState.SyncDeletedRecords;
@@ -181,6 +191,10 @@ module.exports = (pDataClonerService, pOratorServiceServer) =>
181
191
  {
182
192
  tmpFable.MeadowSync.MeadowSyncEntities[tmpReinitEntities[i]].MaxRecordsPerEntity = tmpMaxRecords;
183
193
  }
194
+ if (tmpBody.hasOwnProperty('UseAdvancedIDPagination'))
195
+ {
196
+ tmpFable.MeadowSync.MeadowSyncEntities[tmpReinitEntities[i]].UseAdvancedIDPagination = !!tmpBody.UseAdvancedIDPagination;
197
+ }
184
198
  }
185
199
 
186
200
  return fStartSync();
@@ -295,6 +295,12 @@ class DataClonerProvider extends libPictProvider
295
295
  {
296
296
  document.getElementById('solrSecure').checked = tmpSolrSecure === 'true';
297
297
  }
298
+ // Restore advanced ID pagination checkbox
299
+ let tmpAdvancedIDPagination = localStorage.getItem('dataCloner_syncAdvancedIDPagination');
300
+ if (tmpAdvancedIDPagination !== null)
301
+ {
302
+ document.getElementById('syncAdvancedIDPagination').checked = tmpAdvancedIDPagination === 'true';
303
+ }
298
304
  }
299
305
 
300
306
  initPersistence()
@@ -345,6 +351,16 @@ class DataClonerProvider extends libPictProvider
345
351
  });
346
352
  }
347
353
 
354
+ // Persist advanced ID pagination checkbox
355
+ let tmpAdvancedIDPaginationEl = document.getElementById('syncAdvancedIDPagination');
356
+ if (tmpAdvancedIDPaginationEl)
357
+ {
358
+ tmpAdvancedIDPaginationEl.addEventListener('change', function()
359
+ {
360
+ localStorage.setItem('dataCloner_syncAdvancedIDPagination', this.checked);
361
+ });
362
+ }
363
+
348
364
  // Persist auto-process checkboxes
349
365
  let tmpAutoIds = ['auto1', 'auto2', 'auto3', 'auto4', 'auto5'];
350
366
  for (let a = 0; a < tmpAutoIds.length; a++)
@@ -101,6 +101,7 @@ class DataClonerExportView extends libPictView
101
101
  if (!isNaN(tmpPrecision) && tmpPrecision !== 1000) tmpConfig.Sync.DateTimePrecisionMS = tmpPrecision;
102
102
  let tmpMaxRecords = parseInt(document.getElementById('syncMaxRecords').value, 10);
103
103
  if (tmpMaxRecords > 0) tmpConfig.Sync.MaxRecords = tmpMaxRecords;
104
+ if (document.getElementById('syncAdvancedIDPagination').checked) tmpConfig.Sync.UseAdvancedIDPagination = true;
104
105
 
105
106
  return tmpConfig;
106
107
  }
@@ -169,6 +170,7 @@ class DataClonerExportView extends libPictView
169
170
  let tmpSelectedTables = this.pict.views['DataCloner-Schema'].getSelectedTables();
170
171
  tmpConfig.Sync.SyncEntityList = tmpSelectedTables.length > 0 ? tmpSelectedTables : [];
171
172
  tmpConfig.Sync.SyncEntityOptions = {};
173
+ if (document.getElementById('syncAdvancedIDPagination').checked) tmpConfig.Sync.UseAdvancedIDPagination = true;
172
174
 
173
175
  // ---- SessionManager ----
174
176
  tmpConfig.SessionManager = { Sessions: {} };
@@ -17,6 +17,7 @@ class DataClonerSyncView extends libPictView
17
17
  let tmpSyncMode = document.querySelector('input[name="syncMode"]:checked').value;
18
18
  let tmpMaxRecords = parseInt(document.getElementById('syncMaxRecords').value, 10) || 0;
19
19
  let tmpLogToFile = document.getElementById('syncLogFile').checked;
20
+ let tmpAdvancedIDPagination = document.getElementById('syncAdvancedIDPagination').checked;
20
21
 
21
22
  if (tmpSelectedTables.length === 0)
22
23
  {
@@ -32,6 +33,7 @@ class DataClonerSyncView extends libPictView
32
33
  let tmpPostBody = { Tables: tmpSelectedTables, PageSize: tmpPageSize, DateTimePrecisionMS: tmpDateTimePrecisionMS, SyncDeletedRecords: tmpSyncDeletedRecords, SyncMode: tmpSyncMode };
33
34
  if (tmpMaxRecords > 0) tmpPostBody.MaxRecordsPerEntity = tmpMaxRecords;
34
35
  if (tmpLogToFile) tmpPostBody.LogToFile = true;
36
+ if (tmpAdvancedIDPagination) tmpPostBody.UseAdvancedIDPagination = true;
35
37
  this.pict.providers.DataCloner.api('POST', '/clone/sync/start', tmpPostBody)
36
38
  .then(function(pData)
37
39
  {
@@ -522,6 +524,11 @@ module.exports.default_configuration =
522
524
  <label for="syncDeletedRecords">Sync deleted records (fetch records marked Deleted=1 on source and mirror locally)</label>
523
525
  </div>
524
526
 
527
+ <div class="checkbox-row">
528
+ <input type="checkbox" id="syncAdvancedIDPagination">
529
+ <label for="syncAdvancedIDPagination">Use advanced ID pagination (faster for large tables; uses keyset pagination instead of OFFSET)</label>
530
+ </div>
531
+
525
532
  <div class="inline-group" style="margin-top:8px; margin-bottom:4px">
526
533
  <div style="flex:0 0 200px">
527
534
  <label for="syncMaxRecords">Max Records per Entity</label>
@@ -5161,6 +5161,11 @@
5161
5161
  if (tmpSolrSecure !== null) {
5162
5162
  document.getElementById('solrSecure').checked = tmpSolrSecure === 'true';
5163
5163
  }
5164
+ // Restore advanced ID pagination checkbox
5165
+ let tmpAdvancedIDPagination = localStorage.getItem('dataCloner_syncAdvancedIDPagination');
5166
+ if (tmpAdvancedIDPagination !== null) {
5167
+ document.getElementById('syncAdvancedIDPagination').checked = tmpAdvancedIDPagination === 'true';
5168
+ }
5164
5169
  }
5165
5170
  initPersistence() {
5166
5171
  let tmpSelf = this;
@@ -5203,6 +5208,14 @@
5203
5208
  });
5204
5209
  }
5205
5210
 
5211
+ // Persist advanced ID pagination checkbox
5212
+ let tmpAdvancedIDPaginationEl = document.getElementById('syncAdvancedIDPagination');
5213
+ if (tmpAdvancedIDPaginationEl) {
5214
+ tmpAdvancedIDPaginationEl.addEventListener('change', function () {
5215
+ localStorage.setItem('dataCloner_syncAdvancedIDPagination', this.checked);
5216
+ });
5217
+ }
5218
+
5206
5219
  // Persist auto-process checkboxes
5207
5220
  let tmpAutoIds = ['auto1', 'auto2', 'auto3', 'auto4', 'auto5'];
5208
5221
  for (let a = 0; a < tmpAutoIds.length; a++) {
@@ -6330,6 +6343,7 @@
6330
6343
  if (!isNaN(tmpPrecision) && tmpPrecision !== 1000) tmpConfig.Sync.DateTimePrecisionMS = tmpPrecision;
6331
6344
  let tmpMaxRecords = parseInt(document.getElementById('syncMaxRecords').value, 10);
6332
6345
  if (tmpMaxRecords > 0) tmpConfig.Sync.MaxRecords = tmpMaxRecords;
6346
+ if (document.getElementById('syncAdvancedIDPagination').checked) tmpConfig.Sync.UseAdvancedIDPagination = true;
6333
6347
  return tmpConfig;
6334
6348
  }
6335
6349
  buildMeadowIntegrationConfig() {
@@ -6396,6 +6410,7 @@
6396
6410
  let tmpSelectedTables = this.pict.views['DataCloner-Schema'].getSelectedTables();
6397
6411
  tmpConfig.Sync.SyncEntityList = tmpSelectedTables.length > 0 ? tmpSelectedTables : [];
6398
6412
  tmpConfig.Sync.SyncEntityOptions = {};
6413
+ if (document.getElementById('syncAdvancedIDPagination').checked) tmpConfig.Sync.UseAdvancedIDPagination = true;
6399
6414
 
6400
6415
  // ---- SessionManager ----
6401
6416
  tmpConfig.SessionManager = {
@@ -7445,6 +7460,7 @@ select { background: #fff; width: 100%; padding: 8px 12px; border: 1px solid #cc
7445
7460
  let tmpSyncMode = document.querySelector('input[name="syncMode"]:checked').value;
7446
7461
  let tmpMaxRecords = parseInt(document.getElementById('syncMaxRecords').value, 10) || 0;
7447
7462
  let tmpLogToFile = document.getElementById('syncLogFile').checked;
7463
+ let tmpAdvancedIDPagination = document.getElementById('syncAdvancedIDPagination').checked;
7448
7464
  if (tmpSelectedTables.length === 0) {
7449
7465
  this.pict.providers.DataCloner.setStatus('syncStatus', 'No tables selected for sync.', 'error');
7450
7466
  this.pict.providers.DataCloner.setSectionPhase(5, 'error');
@@ -7462,6 +7478,7 @@ select { background: #fff; width: 100%; padding: 8px 12px; border: 1px solid #cc
7462
7478
  };
7463
7479
  if (tmpMaxRecords > 0) tmpPostBody.MaxRecordsPerEntity = tmpMaxRecords;
7464
7480
  if (tmpLogToFile) tmpPostBody.LogToFile = true;
7481
+ if (tmpAdvancedIDPagination) tmpPostBody.UseAdvancedIDPagination = true;
7465
7482
  this.pict.providers.DataCloner.api('POST', '/clone/sync/start', tmpPostBody).then(function (pData) {
7466
7483
  if (pData.Success) {
7467
7484
  let tmpMsg = pData.SyncMode + ' sync started for ' + pData.Tables.length + ' tables.';
@@ -7852,6 +7869,11 @@ select { background: #fff; width: 100%; padding: 8px 12px; border: 1px solid #cc
7852
7869
  <label for="syncDeletedRecords">Sync deleted records (fetch records marked Deleted=1 on source and mirror locally)</label>
7853
7870
  </div>
7854
7871
 
7872
+ <div class="checkbox-row">
7873
+ <input type="checkbox" id="syncAdvancedIDPagination">
7874
+ <label for="syncAdvancedIDPagination">Use advanced ID pagination (faster for large tables; uses keyset pagination instead of OFFSET)</label>
7875
+ </div>
7876
+
7855
7877
  <div class="inline-group" style="margin-top:8px; margin-bottom:4px">
7856
7878
  <div style="flex:0 0 200px">
7857
7879
  <label for="syncMaxRecords">Max Records per Entity</label>