dbgate-tools 6.7.3 → 6.8.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.
- package/lib/SqlDumper.d.ts +1 -0
- package/lib/SqlDumper.js +63 -9
- package/lib/alterPlan.d.ts +4 -3
- package/lib/alterPlan.js +106 -44
- package/lib/stringTools.js +15 -0
- package/package.json +3 -3
package/lib/SqlDumper.d.ts
CHANGED
|
@@ -116,6 +116,7 @@ export declare class SqlDumper implements AlterProcessor {
|
|
|
116
116
|
selectTableIntoNewTable(sourceName: NamedObjectInfo, targetName: NamedObjectInfo): void;
|
|
117
117
|
truncateTable(name: NamedObjectInfo): void;
|
|
118
118
|
dropConstraints(table: TableInfo, dropReferences?: boolean): void;
|
|
119
|
+
sanitizeTableConstraints(table: TableInfo): TableInfo;
|
|
119
120
|
recreateTable(oldTable: TableInfo, newTable: TableInfo): void;
|
|
120
121
|
createSqlObject(obj: SqlObjectInfo): void;
|
|
121
122
|
getSqlObjectSqlName(ojectTypeField: string): "PROCEDURE" | "VIEW" | "FUNCTION" | "TRIGGER" | "MATERIALIZED VIEW" | "EVENT";
|
package/lib/SqlDumper.js
CHANGED
|
@@ -10,6 +10,7 @@ const isDate_1 = __importDefault(require("lodash/isDate"));
|
|
|
10
10
|
const isArray_1 = __importDefault(require("lodash/isArray"));
|
|
11
11
|
const isPlainObject_1 = __importDefault(require("lodash/isPlainObject"));
|
|
12
12
|
const keys_1 = __importDefault(require("lodash/keys"));
|
|
13
|
+
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
13
14
|
const v1_1 = __importDefault(require("uuid/v1"));
|
|
14
15
|
class SqlDumper {
|
|
15
16
|
static convertKeywordCase(keyword) {
|
|
@@ -76,6 +77,8 @@ class SqlDumper {
|
|
|
76
77
|
}
|
|
77
78
|
else if (value === null || value === void 0 ? void 0 : value.$bigint)
|
|
78
79
|
this.putRaw(value === null || value === void 0 ? void 0 : value.$bigint);
|
|
80
|
+
else if (value === null || value === void 0 ? void 0 : value.$decimal)
|
|
81
|
+
this.putRaw(value === null || value === void 0 ? void 0 : value.$decimal);
|
|
79
82
|
else if ((0, isPlainObject_1.default)(value) || (0, isArray_1.default)(value))
|
|
80
83
|
this.putStringValue(JSON.stringify(value));
|
|
81
84
|
else
|
|
@@ -598,6 +601,55 @@ class SqlDumper {
|
|
|
598
601
|
this.dropPrimaryKey(table.primaryKey);
|
|
599
602
|
}
|
|
600
603
|
}
|
|
604
|
+
sanitizeTableConstraints(table) {
|
|
605
|
+
// Create a deep copy of the table
|
|
606
|
+
const sanitized = (0, cloneDeep_1.default)(table);
|
|
607
|
+
// Get the set of existing column names
|
|
608
|
+
const existingColumns = new Set(sanitized.columns.map(col => col.columnName));
|
|
609
|
+
// Filter primary key columns to only include existing columns
|
|
610
|
+
if (sanitized.primaryKey) {
|
|
611
|
+
const validPkColumns = sanitized.primaryKey.columns.filter(col => existingColumns.has(col.columnName));
|
|
612
|
+
if (validPkColumns.length === 0) {
|
|
613
|
+
// If no valid columns remain, remove the primary key entirely
|
|
614
|
+
sanitized.primaryKey = null;
|
|
615
|
+
}
|
|
616
|
+
else if (validPkColumns.length < sanitized.primaryKey.columns.length) {
|
|
617
|
+
// Update primary key with only valid columns
|
|
618
|
+
sanitized.primaryKey = {
|
|
619
|
+
...sanitized.primaryKey,
|
|
620
|
+
columns: validPkColumns
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
// Filter sorting key columns to only include existing columns
|
|
625
|
+
if (sanitized.sortingKey) {
|
|
626
|
+
const validSkColumns = sanitized.sortingKey.columns.filter(col => existingColumns.has(col.columnName));
|
|
627
|
+
if (validSkColumns.length === 0) {
|
|
628
|
+
sanitized.sortingKey = null;
|
|
629
|
+
}
|
|
630
|
+
else if (validSkColumns.length < sanitized.sortingKey.columns.length) {
|
|
631
|
+
sanitized.sortingKey = {
|
|
632
|
+
...sanitized.sortingKey,
|
|
633
|
+
columns: validSkColumns
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
// Filter foreign keys to only include those with all columns present
|
|
638
|
+
if (sanitized.foreignKeys) {
|
|
639
|
+
sanitized.foreignKeys = sanitized.foreignKeys.filter(fk => fk.columns.every(col => existingColumns.has(col.columnName)));
|
|
640
|
+
}
|
|
641
|
+
// Filter indexes to only include those with all columns present
|
|
642
|
+
if (sanitized.indexes) {
|
|
643
|
+
sanitized.indexes = sanitized.indexes.filter(idx => idx.columns.every(col => existingColumns.has(col.columnName)));
|
|
644
|
+
}
|
|
645
|
+
// Filter unique constraints to only include those with all columns present
|
|
646
|
+
if (sanitized.uniques) {
|
|
647
|
+
sanitized.uniques = sanitized.uniques.filter(uq => uq.columns.every(col => existingColumns.has(col.columnName)));
|
|
648
|
+
}
|
|
649
|
+
// Filter dependencies (references from other tables) - these should remain as-is
|
|
650
|
+
// since they don't affect the CREATE TABLE statement for this table
|
|
651
|
+
return sanitized;
|
|
652
|
+
}
|
|
601
653
|
recreateTable(oldTable, newTable) {
|
|
602
654
|
if (!oldTable.pairingId || !newTable.pairingId || oldTable.pairingId != newTable.pairingId) {
|
|
603
655
|
throw new Error('Recreate is not possible: oldTable.paringId != newTable.paringId');
|
|
@@ -609,29 +661,31 @@ class SqlDumper {
|
|
|
609
661
|
newcol: newTable.columns.find(x => x.pairingId == oldcol.pairingId),
|
|
610
662
|
}))
|
|
611
663
|
.filter(x => x.newcol);
|
|
664
|
+
// Create a sanitized version of newTable with constraints that only reference existing columns
|
|
665
|
+
const sanitizedNewTable = this.sanitizeTableConstraints(newTable);
|
|
612
666
|
if (this.driver.supportsTransactions) {
|
|
613
667
|
this.dropConstraints(oldTable, true);
|
|
614
668
|
this.renameTable(oldTable, tmpTable);
|
|
615
|
-
this.createTable(
|
|
616
|
-
const autoinc =
|
|
669
|
+
this.createTable(sanitizedNewTable);
|
|
670
|
+
const autoinc = sanitizedNewTable.columns.find(x => x.autoIncrement);
|
|
617
671
|
if (autoinc) {
|
|
618
|
-
this.allowIdentityInsert(
|
|
672
|
+
this.allowIdentityInsert(sanitizedNewTable, true);
|
|
619
673
|
}
|
|
620
|
-
this.putCmd('^insert ^into %f (%,i) select %,i ^from %f',
|
|
674
|
+
this.putCmd('^insert ^into %f (%,i) select %,i ^from %f', sanitizedNewTable, columnPairs.map(x => x.newcol.columnName), columnPairs.map(x => x.oldcol.columnName), { ...oldTable, pureName: tmpTable });
|
|
621
675
|
if (autoinc) {
|
|
622
|
-
this.allowIdentityInsert(
|
|
676
|
+
this.allowIdentityInsert(sanitizedNewTable, false);
|
|
623
677
|
}
|
|
624
678
|
if (this.dialect.dropForeignKey) {
|
|
625
|
-
|
|
679
|
+
sanitizedNewTable.dependencies.forEach(cnt => this.createConstraint(cnt));
|
|
626
680
|
}
|
|
627
681
|
this.dropTable({ ...oldTable, pureName: tmpTable });
|
|
628
682
|
}
|
|
629
683
|
else {
|
|
630
684
|
// we have to preserve old table as long as possible
|
|
631
|
-
this.createTable({ ...
|
|
632
|
-
this.putCmd('^insert ^into %f (%,i) select %,s ^from %f', { ...
|
|
685
|
+
this.createTable({ ...sanitizedNewTable, pureName: tmpTable });
|
|
686
|
+
this.putCmd('^insert ^into %f (%,i) select %,s ^from %f', { ...sanitizedNewTable, pureName: tmpTable }, columnPairs.map(x => x.newcol.columnName), columnPairs.map(x => x.oldcol.columnName), oldTable);
|
|
633
687
|
this.dropTable(oldTable);
|
|
634
|
-
this.renameTable({ ...
|
|
688
|
+
this.renameTable({ ...sanitizedNewTable, pureName: tmpTable }, newTable.pureName);
|
|
635
689
|
}
|
|
636
690
|
}
|
|
637
691
|
createSqlObject(obj) {
|
package/lib/alterPlan.d.ts
CHANGED
|
@@ -65,8 +65,8 @@ interface AlterOperation_RenameConstraint {
|
|
|
65
65
|
}
|
|
66
66
|
interface AlterOperation_RecreateTable {
|
|
67
67
|
operationType: 'recreateTable';
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
oldTable: TableInfo;
|
|
69
|
+
newTable: TableInfo;
|
|
70
70
|
}
|
|
71
71
|
interface AlterOperation_FillPreloadedRows {
|
|
72
72
|
operationType: 'fillPreloadedRows';
|
|
@@ -110,7 +110,7 @@ export declare class AlterPlan {
|
|
|
110
110
|
renameSqlObject(table: TableInfo, newName: string): void;
|
|
111
111
|
renameColumn(column: ColumnInfo, newName: string): void;
|
|
112
112
|
renameConstraint(constraint: ConstraintInfo, newName: string): void;
|
|
113
|
-
recreateTable(
|
|
113
|
+
recreateTable(oldTable: TableInfo, newTable: TableInfo): void;
|
|
114
114
|
fillPreloadedRows(table: NamedObjectInfo, oldRows: any[], newRows: any[], key: string[], insertOnly: string[], autoIncrementColumn: string): void;
|
|
115
115
|
setTableOption(table: TableInfo, optionName: string, optionValue: string): void;
|
|
116
116
|
run(processor: AlterProcessor): void;
|
|
@@ -121,6 +121,7 @@ export declare class AlterPlan {
|
|
|
121
121
|
_canCreateConstraint(cnt: ConstraintInfo): boolean;
|
|
122
122
|
_canDropConstraint(cnt: ConstraintInfo): boolean;
|
|
123
123
|
_testTableRecreate(op: AlterOperation, operationType: string, isAllowed: boolean | Function, objectField: string): AlterOperation[] | null;
|
|
124
|
+
_removeRecreatedTableAlters(): AlterOperation[];
|
|
124
125
|
_groupTableRecreations(): AlterOperation[];
|
|
125
126
|
_moveForeignKeysToLast(): AlterOperation[];
|
|
126
127
|
_filterAllowedOperations(): AlterOperation[];
|
package/lib/alterPlan.js
CHANGED
|
@@ -5,9 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.runAlterOperation = exports.AlterPlan = void 0;
|
|
7
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
-
const diffTools_1 = require("./diffTools");
|
|
9
|
-
const database_info_alter_processor_1 = require("./database-info-alter-processor");
|
|
10
|
-
const DatabaseAnalyser_1 = require("./DatabaseAnalyser");
|
|
11
8
|
class AlterPlan {
|
|
12
9
|
constructor(wholeOldDb, wholeNewDb, dialect, opts) {
|
|
13
10
|
this.wholeOldDb = wholeOldDb;
|
|
@@ -111,11 +108,11 @@ class AlterPlan {
|
|
|
111
108
|
newName,
|
|
112
109
|
});
|
|
113
110
|
}
|
|
114
|
-
recreateTable(
|
|
111
|
+
recreateTable(oldTable, newTable) {
|
|
115
112
|
this.operations.push({
|
|
116
113
|
operationType: 'recreateTable',
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
oldTable,
|
|
115
|
+
newTable,
|
|
119
116
|
});
|
|
120
117
|
this.recreates.tables += 1;
|
|
121
118
|
}
|
|
@@ -181,7 +178,11 @@ class AlterPlan {
|
|
|
181
178
|
return opRes;
|
|
182
179
|
}),
|
|
183
180
|
op,
|
|
184
|
-
]
|
|
181
|
+
].filter(op => {
|
|
182
|
+
// filter duplicated drops
|
|
183
|
+
const existingDrop = this.operations.find(o => o.operationType == 'dropConstraint' && o.oldObject === op['oldObject']);
|
|
184
|
+
return existingDrop == null;
|
|
185
|
+
});
|
|
185
186
|
return res;
|
|
186
187
|
}
|
|
187
188
|
for (const [testedOperationType, testedDependencies, testedObject] of [
|
|
@@ -325,50 +326,110 @@ class AlterPlan {
|
|
|
325
326
|
// skip this operation, as it cannot be achieved
|
|
326
327
|
return [];
|
|
327
328
|
}
|
|
328
|
-
const
|
|
329
|
+
const oldTable = this.wholeOldDb.tables.find(x => x.pureName == op[objectField].pureName && x.schemaName == op[objectField].schemaName);
|
|
330
|
+
const newTable = this.wholeNewDb.tables.find(x => x.pureName == op[objectField].pureName && x.schemaName == op[objectField].schemaName);
|
|
329
331
|
this.recreates.tables += 1;
|
|
330
332
|
return [
|
|
331
333
|
{
|
|
332
334
|
operationType: 'recreateTable',
|
|
333
|
-
|
|
334
|
-
|
|
335
|
+
oldTable,
|
|
336
|
+
newTable,
|
|
337
|
+
// operations: [op],
|
|
335
338
|
},
|
|
336
339
|
];
|
|
337
340
|
}
|
|
338
341
|
return null;
|
|
339
342
|
}
|
|
340
|
-
|
|
343
|
+
_removeRecreatedTableAlters() {
|
|
341
344
|
const res = [];
|
|
342
|
-
const recreates =
|
|
345
|
+
const recreates = new Set();
|
|
343
346
|
for (const op of this.operations) {
|
|
344
|
-
if (op.operationType == 'recreateTable' && op.
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
existingRecreate.operations.push(...op.operations);
|
|
348
|
-
}
|
|
349
|
-
else {
|
|
350
|
-
const recreate = {
|
|
351
|
-
...op,
|
|
352
|
-
operations: [...op.operations],
|
|
353
|
-
};
|
|
354
|
-
res.push(recreate);
|
|
355
|
-
recreates[`${op.table.schemaName}||${op.table.pureName}`] = recreate;
|
|
356
|
-
}
|
|
347
|
+
if (op.operationType == 'recreateTable' && op.oldTable && op.newTable) {
|
|
348
|
+
const key = `${op.oldTable.schemaName}||${op.oldTable.pureName}`;
|
|
349
|
+
recreates.add(key);
|
|
357
350
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
351
|
+
}
|
|
352
|
+
for (const op of this.operations) {
|
|
353
|
+
switch (op.operationType) {
|
|
354
|
+
case 'createColumn':
|
|
355
|
+
case 'createConstraint':
|
|
356
|
+
{
|
|
357
|
+
const key = `${op.newObject.schemaName}||${op.newObject.pureName}`;
|
|
358
|
+
if (recreates.has(key)) {
|
|
359
|
+
// skip create inside recreated table
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
break;
|
|
364
|
+
case 'dropColumn':
|
|
365
|
+
case 'dropConstraint':
|
|
366
|
+
case 'changeColumn':
|
|
367
|
+
{
|
|
368
|
+
const key = `${op.oldObject.schemaName}||${op.oldObject.pureName}`;
|
|
369
|
+
if (recreates.has(key)) {
|
|
370
|
+
// skip drop/change inside recreated table
|
|
371
|
+
continue;
|
|
372
|
+
}
|
|
366
373
|
}
|
|
374
|
+
break;
|
|
375
|
+
case 'renameColumn':
|
|
376
|
+
{
|
|
377
|
+
const key = `${op.object.schemaName}||${op.object.pureName}`;
|
|
378
|
+
if (recreates.has(key)) {
|
|
379
|
+
// skip rename inside recreated table
|
|
380
|
+
continue;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
break;
|
|
384
|
+
}
|
|
385
|
+
res.push(op);
|
|
386
|
+
}
|
|
387
|
+
return res;
|
|
388
|
+
}
|
|
389
|
+
_groupTableRecreations() {
|
|
390
|
+
const res = [];
|
|
391
|
+
const recreates = new Set();
|
|
392
|
+
for (const op of this.operations) {
|
|
393
|
+
if (op.operationType == 'recreateTable' && op.oldTable && op.newTable) {
|
|
394
|
+
const key = `${op.oldTable.schemaName}||${op.oldTable.pureName}`;
|
|
395
|
+
if (recreates.has(key)) {
|
|
396
|
+
// prevent duplicate recreates
|
|
397
|
+
continue;
|
|
367
398
|
}
|
|
368
|
-
|
|
399
|
+
recreates.add(key);
|
|
369
400
|
}
|
|
401
|
+
res.push(op);
|
|
370
402
|
}
|
|
371
403
|
return res;
|
|
404
|
+
// const res = [];
|
|
405
|
+
// const recreates = {};
|
|
406
|
+
// for (const op of this.operations) {
|
|
407
|
+
// if (op.operationType == 'recreateTable' && op.table) {
|
|
408
|
+
// const existingRecreate = recreates[`${op.table.schemaName}||${op.table.pureName}`];
|
|
409
|
+
// if (existingRecreate) {
|
|
410
|
+
// existingRecreate.operations.push(...op.operations);
|
|
411
|
+
// } else {
|
|
412
|
+
// const recreate = {
|
|
413
|
+
// ...op,
|
|
414
|
+
// operations: [...op.operations],
|
|
415
|
+
// };
|
|
416
|
+
// res.push(recreate);
|
|
417
|
+
// recreates[`${op.table.schemaName}||${op.table.pureName}`] = recreate;
|
|
418
|
+
// }
|
|
419
|
+
// } else {
|
|
420
|
+
// // @ts-ignore
|
|
421
|
+
// const oldObject: TableInfo = op.oldObject || op.object;
|
|
422
|
+
// if (oldObject) {
|
|
423
|
+
// const recreated = recreates[`${oldObject.schemaName}||${oldObject.pureName}`];
|
|
424
|
+
// if (recreated) {
|
|
425
|
+
// recreated.operations.push(op);
|
|
426
|
+
// continue;
|
|
427
|
+
// }
|
|
428
|
+
// }
|
|
429
|
+
// res.push(op);
|
|
430
|
+
// }
|
|
431
|
+
// }
|
|
432
|
+
// return res;
|
|
372
433
|
}
|
|
373
434
|
_moveForeignKeysToLast() {
|
|
374
435
|
if (!this.dialect.createForeignKey) {
|
|
@@ -427,6 +488,7 @@ class AlterPlan {
|
|
|
427
488
|
// console.log('*****************OPERATIONS2', this.operations);
|
|
428
489
|
this.operations = this._groupTableRecreations();
|
|
429
490
|
// console.log('*****************OPERATIONS3', this.operations);
|
|
491
|
+
this.operations = this._removeRecreatedTableAlters();
|
|
430
492
|
this.operations = this._moveForeignKeysToLast();
|
|
431
493
|
// console.log('*****************OPERATIONS4', this.operations);
|
|
432
494
|
this.operations = this._filterAllowedOperations();
|
|
@@ -486,16 +548,16 @@ function runAlterOperation(op, processor) {
|
|
|
486
548
|
break;
|
|
487
549
|
case 'recreateTable':
|
|
488
550
|
{
|
|
489
|
-
const oldTable =
|
|
490
|
-
const newTable =
|
|
491
|
-
const newDb =
|
|
492
|
-
newDb.tables.push(newTable);
|
|
493
|
-
// console.log('////////////////////////////newTable1', newTable);
|
|
494
|
-
op.operations.forEach(child => runAlterOperation(child, new
|
|
495
|
-
// console.log('////////////////////////////op.operations', op.operations);
|
|
496
|
-
// console.log('////////////////////////////op.table', op.table);
|
|
497
|
-
// console.log('////////////////////////////newTable2', newTable);
|
|
498
|
-
processor.recreateTable(oldTable, newTable);
|
|
551
|
+
// const oldTable = generateTablePairingId(op.table);
|
|
552
|
+
// const newTable = _.cloneDeep(oldTable);
|
|
553
|
+
// const newDb = DatabaseAnalyser.createEmptyStructure();
|
|
554
|
+
// newDb.tables.push(newTable);
|
|
555
|
+
// // console.log('////////////////////////////newTable1', newTable);
|
|
556
|
+
// op.operations.forEach(child => runAlterOperation(child, new DatabaseInfoAlterProcessor(newDb)));
|
|
557
|
+
// // console.log('////////////////////////////op.operations', op.operations);
|
|
558
|
+
// // console.log('////////////////////////////op.table', op.table);
|
|
559
|
+
// // console.log('////////////////////////////newTable2', newTable);
|
|
560
|
+
processor.recreateTable(op.oldTable, op.newTable);
|
|
499
561
|
}
|
|
500
562
|
break;
|
|
501
563
|
}
|
package/lib/stringTools.js
CHANGED
|
@@ -243,6 +243,12 @@ function stringifyCellValue(value, intent, editorTypes, gridFormattingOptions, j
|
|
|
243
243
|
gridStyle: 'valueCellStyle',
|
|
244
244
|
};
|
|
245
245
|
}
|
|
246
|
+
if (value === null || value === void 0 ? void 0 : value.$decimal) {
|
|
247
|
+
return {
|
|
248
|
+
value: formatCellNumber(value.$decimal, gridFormattingOptions),
|
|
249
|
+
gridStyle: 'valueCellStyle',
|
|
250
|
+
};
|
|
251
|
+
}
|
|
246
252
|
if (editorTypes === null || editorTypes === void 0 ? void 0 : editorTypes.parseHexAsBuffer) {
|
|
247
253
|
// if (value?.type == 'Buffer' && _isArray(value.data)) {
|
|
248
254
|
// return { value: '0x' + arrayToHexString(value.data), gridStyle: 'valueCellStyle' };
|
|
@@ -428,6 +434,9 @@ function shouldOpenMultilineDialog(value) {
|
|
|
428
434
|
if (value === null || value === void 0 ? void 0 : value.$bigint) {
|
|
429
435
|
return false;
|
|
430
436
|
}
|
|
437
|
+
if (value === null || value === void 0 ? void 0 : value.$decimal) {
|
|
438
|
+
return false;
|
|
439
|
+
}
|
|
431
440
|
if ((0, isPlainObject_1.default)(value) || (0, isArray_1.default)(value)) {
|
|
432
441
|
return true;
|
|
433
442
|
}
|
|
@@ -691,6 +700,9 @@ function deserializeJsTypesFromJsonParse(obj) {
|
|
|
691
700
|
if (value === null || value === void 0 ? void 0 : value.$bigint) {
|
|
692
701
|
return BigInt(value.$bigint);
|
|
693
702
|
}
|
|
703
|
+
if (value === null || value === void 0 ? void 0 : value.$decimal) {
|
|
704
|
+
return value.$decimal;
|
|
705
|
+
}
|
|
694
706
|
});
|
|
695
707
|
}
|
|
696
708
|
exports.deserializeJsTypesFromJsonParse = deserializeJsTypesFromJsonParse;
|
|
@@ -705,6 +717,9 @@ function deserializeJsTypesReviver(key, value) {
|
|
|
705
717
|
if (value === null || value === void 0 ? void 0 : value.$bigint) {
|
|
706
718
|
return BigInt(value.$bigint);
|
|
707
719
|
}
|
|
720
|
+
if (value === null || value === void 0 ? void 0 : value.$decimal) {
|
|
721
|
+
return value.$decimal;
|
|
722
|
+
}
|
|
708
723
|
return value;
|
|
709
724
|
}
|
|
710
725
|
exports.deserializeJsTypesReviver = deserializeJsTypesReviver;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "6.
|
|
2
|
+
"version": "6.8.0",
|
|
3
3
|
"name": "dbgate-tools",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"typings": "lib/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^13.7.0",
|
|
29
|
-
"dbgate-types": "^6.
|
|
29
|
+
"dbgate-types": "^6.8.0",
|
|
30
30
|
"jest": "^28.1.3",
|
|
31
31
|
"ts-jest": "^28.0.7",
|
|
32
32
|
"typescript": "^4.4.3"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"blueimp-md5": "^2.19.0",
|
|
36
36
|
"dbgate-query-splitter": "^4.11.9",
|
|
37
|
-
"dbgate-sqltree": "^6.
|
|
37
|
+
"dbgate-sqltree": "^6.8.0",
|
|
38
38
|
"debug": "^4.3.4",
|
|
39
39
|
"json-stable-stringify": "^1.0.1",
|
|
40
40
|
"lodash": "^4.17.21",
|