dbgate-tools
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -15,3 +15,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const lodash_1 = __importDefault(require("lodash")); | ||
const intersection_1 = __importDefault(require("lodash/intersection")); | ||
const tableTransforms_1 = require("./tableTransforms"); | ||
@@ -55,3 +55,3 @@ function createBulkInsertStreamBase(driver, stream, pool, name, options) { | ||
} | ||
this.columnNames = lodash_1.default.intersection(structure.columns.map((x) => x.columnName), writable.structure.columns.map((x) => x.columnName)); | ||
this.columnNames = intersection_1.default(structure.columns.map((x) => x.columnName), writable.structure.columns.map((x) => x.columnName)); | ||
}); | ||
@@ -58,0 +58,0 @@ writable.send = () => __awaiter(this, void 0, void 0, function* () { |
@@ -15,4 +15,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const lodash_1 = __importDefault(require("lodash")); | ||
const fp_1 = __importDefault(require("lodash/fp")); | ||
const sortBy_1 = __importDefault(require("lodash/sortBy")); | ||
const groupBy_1 = __importDefault(require("lodash/groupBy")); | ||
const pick_1 = __importDefault(require("lodash/pick")); | ||
const pick_2 = __importDefault(require("lodash/fp/pick")); | ||
class DatabaseAnalyser { | ||
@@ -68,3 +70,3 @@ constructor(pool, driver) { | ||
const removeAllIds = [...removedIds, ...addedChangedIds]; | ||
res[field] = lodash_1.default.sortBy([...this.structure[field].filter((x) => !removeAllIds.includes(extractObjectId(x))), ...newArray], (x) => x.pureName); | ||
res[field] = sortBy_1.default([...this.structure[field].filter((x) => !removeAllIds.includes(extractObjectId(x))), ...newArray], (x) => x.pureName); | ||
} | ||
@@ -97,7 +99,7 @@ return res; | ||
return undefined; | ||
return Object.assign(Object.assign({}, lodash_1.default.pick(filtered[0], ['constraintName', 'schemaName', 'pureName'])), { constraintType: 'primaryKey', columns: filtered.map(fp_1.default.pick('columnName')) }); | ||
return Object.assign(Object.assign({}, pick_1.default(filtered[0], ['constraintName', 'schemaName', 'pureName'])), { constraintType: 'primaryKey', columns: filtered.map(pick_2.default('columnName')) }); | ||
} | ||
static extractForeignKeys(table, fkColumns) { | ||
const grouped = lodash_1.default.groupBy(fkColumns.filter(DatabaseAnalyser.byTableFilter(table)), 'constraintName'); | ||
return lodash_1.default.keys(grouped).map((constraintName) => (Object.assign(Object.assign({ constraintName, constraintType: 'foreignKey' }, lodash_1.default.pick(grouped[constraintName][0], [ | ||
const grouped = groupBy_1.default(fkColumns.filter(DatabaseAnalyser.byTableFilter(table)), 'constraintName'); | ||
return Object.keys(grouped).map((constraintName) => (Object.assign(Object.assign({ constraintName, constraintType: 'foreignKey' }, pick_1.default(grouped[constraintName][0], [ | ||
'constraintName', | ||
@@ -110,5 +112,5 @@ 'schemaName', | ||
'deleteAction', | ||
])), { columns: grouped[constraintName].map(fp_1.default.pick(['columnName', 'refColumnName'])) }))); | ||
])), { columns: grouped[constraintName].map(pick_2.default(['columnName', 'refColumnName'])) }))); | ||
} | ||
} | ||
exports.DatabaseAnalyser = DatabaseAnalyser; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const lodash_1 = __importDefault(require("lodash")); | ||
const camelCase_1 = __importDefault(require("lodash/camelCase")); | ||
function extractShellApiPlugins(functionName, props) { | ||
@@ -26,3 +26,3 @@ const res = []; | ||
if (nsMatch) { | ||
return `${lodash_1.default.camelCase(nsMatch[2])}.shellApi.${nsMatch[1]}`; | ||
return `${camelCase_1.default(nsMatch[2])}.shellApi.${nsMatch[1]}`; | ||
} | ||
@@ -29,0 +29,0 @@ return `dbgateApi.${functionName}`; |
@@ -6,4 +6,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const lodash_1 = __importDefault(require("lodash")); | ||
const moment_1 = __importDefault(require("moment")); | ||
const isString_1 = __importDefault(require("lodash/isString")); | ||
const isNumber_1 = __importDefault(require("lodash/isNumber")); | ||
const isDate_1 = __importDefault(require("lodash/isDate")); | ||
class SqlDumper { | ||
@@ -46,8 +47,8 @@ constructor(driver) { | ||
this.putRaw('0'); | ||
else if (lodash_1.default.isString(value)) | ||
else if (isString_1.default(value)) | ||
this.putStringValue(value); | ||
else if (lodash_1.default.isNumber(value)) | ||
else if (isNumber_1.default(value)) | ||
this.putRaw(value.toString()); | ||
else if (lodash_1.default.isDate(value)) | ||
this.putStringValue(moment_1.default(value).toISOString()); | ||
else if (isDate_1.default(value)) | ||
this.putStringValue(new Date(value).toISOString()); | ||
} | ||
@@ -54,0 +55,0 @@ putCmd(format, ...args) { |
@@ -6,5 +6,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const lodash_1 = __importDefault(require("lodash")); | ||
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep")); | ||
function prepareTableForImport(table) { | ||
const res = lodash_1.default.cloneDeep(table); | ||
const res = cloneDeep_1.default(table); | ||
res.foreignKeys = []; | ||
@@ -11,0 +11,0 @@ if (res.primaryKey) |
{ | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"name": "dbgate-tools", | ||
"main": "lib/index.js", | ||
"typings": "lib/index.d.ts", | ||
"homepage": "https://dbgate.org/", | ||
@@ -11,7 +10,6 @@ "repository": { | ||
"url": "https://github.com/dbshell/dbgate.git" | ||
}, | ||
}, | ||
"funding": "https://www.paypal.com/paypalme/JanProchazkaCz/30eur", | ||
"author": "Jan Prochazka", | ||
"license": "GPL", | ||
"keywords": [ | ||
@@ -21,3 +19,2 @@ "sql", | ||
], | ||
"scripts": { | ||
@@ -33,4 +30,4 @@ "prepare": "yarn build", | ||
"devDependencies": { | ||
"@types/node": "^13.7.0", | ||
"dbgate-types": "^1.0.0", | ||
"@types/node": "^13.7.0", | ||
"jest": "^24.9.0", | ||
@@ -41,5 +38,4 @@ "ts-jest": "^25.2.1", | ||
"dependencies": { | ||
"lodash": "^4.17.15", | ||
"moment": "^2.24.0" | ||
"lodash": "^4.17.15" | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
29621
1
732
0
- Removedmoment@^2.24.0
- Removedmoment@2.30.1(transitive)