dbgate-tools 5.5.4-alpha.7 → 5.5.4-alpha.8
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.js +4 -4
- package/package.json +3 -3
package/lib/SqlDumper.js
CHANGED
|
@@ -4,12 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.SqlDumper = void 0;
|
|
7
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
8
7
|
const isString_1 = __importDefault(require("lodash/isString"));
|
|
9
8
|
const isNumber_1 = __importDefault(require("lodash/isNumber"));
|
|
10
9
|
const isDate_1 = __importDefault(require("lodash/isDate"));
|
|
11
10
|
const isArray_1 = __importDefault(require("lodash/isArray"));
|
|
12
11
|
const isPlainObject_1 = __importDefault(require("lodash/isPlainObject"));
|
|
12
|
+
const keys_1 = __importDefault(require("lodash/keys"));
|
|
13
13
|
const v1_1 = __importDefault(require("uuid/v1"));
|
|
14
14
|
class SqlDumper {
|
|
15
15
|
static convertKeywordCase(keyword) {
|
|
@@ -221,7 +221,7 @@ class SqlDumper {
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
columnDefinition(column, { includeDefault = true, includeNullable = true, includeCollate = true } = {}) {
|
|
224
|
-
var _a, _b;
|
|
224
|
+
var _a, _b, _c;
|
|
225
225
|
if (column.computedExpression) {
|
|
226
226
|
this.put('^as %s', column.computedExpression);
|
|
227
227
|
if (column.isPersisted)
|
|
@@ -237,7 +237,7 @@ class SqlDumper {
|
|
|
237
237
|
if (includeNullable && !((_a = this.dialect) === null || _a === void 0 ? void 0 : _a.specificNullabilityImplementation)) {
|
|
238
238
|
this.put(column.notNull ? '^not ^null' : '^null');
|
|
239
239
|
}
|
|
240
|
-
if (includeDefault && ((_b = column.defaultValue) === null || _b === void 0 ? void 0 : _b.trim())) {
|
|
240
|
+
if (includeDefault && ((_c = (_b = column.defaultValue) === null || _b === void 0 ? void 0 : _b.toString()) === null || _c === void 0 ? void 0 : _c.trim())) {
|
|
241
241
|
this.columnDefault(column);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
@@ -634,7 +634,7 @@ class SqlDumper {
|
|
|
634
634
|
let was = false;
|
|
635
635
|
for (const row of newRows) {
|
|
636
636
|
const old = oldRows === null || oldRows === void 0 ? void 0 : oldRows.find(r => key.every(col => r[col] == row[col]));
|
|
637
|
-
const rowKeys =
|
|
637
|
+
const rowKeys = (0, keys_1.default)(row);
|
|
638
638
|
if (old) {
|
|
639
639
|
const updated = [];
|
|
640
640
|
for (const col of rowKeys) {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.5.4-alpha.
|
|
2
|
+
"version": "5.5.4-alpha.8",
|
|
3
3
|
"name": "dbgate-tools",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"typings": "lib/index.d.ts",
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
],
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "^13.7.0",
|
|
28
|
-
"dbgate-types": "^5.5.4-alpha.
|
|
28
|
+
"dbgate-types": "^5.5.4-alpha.8",
|
|
29
29
|
"jest": "^24.9.0",
|
|
30
30
|
"ts-jest": "^25.2.1",
|
|
31
31
|
"typescript": "^4.4.3"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"dbgate-query-splitter": "^4.10.5",
|
|
35
|
-
"dbgate-sqltree": "^5.5.4-alpha.
|
|
35
|
+
"dbgate-sqltree": "^5.5.4-alpha.8",
|
|
36
36
|
"debug": "^4.3.4",
|
|
37
37
|
"json-stable-stringify": "^1.0.1",
|
|
38
38
|
"lodash": "^4.17.21",
|