@naturalcycles/db-lib 10.41.1 → 10.42.0
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.
|
@@ -386,6 +386,12 @@ export class CommonDao {
|
|
|
386
386
|
}
|
|
387
387
|
prepareSaveOptions(opt) {
|
|
388
388
|
let { saveMethod, assignGeneratedIds = this.cfg.assignGeneratedIds, excludeFromIndexes = this.cfg.excludeFromIndexes, } = opt;
|
|
389
|
+
if (this.cfg.compress?.keys) {
|
|
390
|
+
excludeFromIndexes ??= [];
|
|
391
|
+
if (!excludeFromIndexes.includes('data')) {
|
|
392
|
+
excludeFromIndexes.push('data');
|
|
393
|
+
}
|
|
394
|
+
}
|
|
389
395
|
if (this.cfg.immutable && !opt.allowMutability && !opt.saveMethod) {
|
|
390
396
|
saveMethod = 'insert';
|
|
391
397
|
}
|
package/package.json
CHANGED
|
@@ -522,6 +522,14 @@ export class CommonDao<
|
|
|
522
522
|
assignGeneratedIds = this.cfg.assignGeneratedIds,
|
|
523
523
|
excludeFromIndexes = this.cfg.excludeFromIndexes,
|
|
524
524
|
} = opt
|
|
525
|
+
|
|
526
|
+
if (this.cfg.compress?.keys) {
|
|
527
|
+
excludeFromIndexes ??= []
|
|
528
|
+
if (!excludeFromIndexes.includes('data' as any)) {
|
|
529
|
+
excludeFromIndexes.push('data' as any)
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
525
533
|
if (this.cfg.immutable && !opt.allowMutability && !opt.saveMethod) {
|
|
526
534
|
saveMethod = 'insert'
|
|
527
535
|
}
|