diff --git a/.gitignore b/.gitignore index ae970dde..82216f34 100755 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules logs_directory dist +tsconfig.tsbuildinfo diff --git a/README.md b/README.md index 7c5edae1..c9ee9651 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ Or, if you have moved config folder out from Nmig's directory:
Note: "logs_directory" will be created during script execution.

VERSION

-

Current version is 5.6.0
+

Current version is 5.7.0

LICENSE

NMIG is available under "GNU GENERAL PUBLIC LICENSE" (v. 3)
diff --git a/config/config.json b/config/config.json index be2c9d24..b3f7cc3a 100644 --- a/config/config.json +++ b/config/config.json @@ -8,10 +8,11 @@ "Connection parameters to your MySQL database", "Please ensure, that you have defined all parameters properly.", "Ensure, that details like 'charset' are included (if necessary).", - "Notice, any parameter, acceptable by the node mysql module can be placed here." + "Note, any parameter, acceptable by the node mysql module can be placed here.", + "Check the 'source.host' parameter, that can be either '127.0.0.1' or 'localhost', depends on your setup." ], "source" : { - "host" : "localhost", + "host" : "127.0.0.1", "port" : 3306, "database" : "test_db", "charset" : "utf8mb4", @@ -24,10 +25,11 @@ "Connection parameters to your PostgreSQL database", "Please ensure, that you have defined all parameters properly.", "Ensure, that details like 'charset' are included (if necessary).", - "Notice, any parameter, acceptable by the node pg module can be placed here." + "Note, any parameter, acceptable by the node pg module can be placed here.", + "Check the 'target.host' parameter, that can be either '127.0.0.1' or 'localhost', depends on your setup." ], "target" : { - "host" : "localhost", + "host" : "127.0.0.1", "port" : 5432, "database" : "test_db", "charset" : "UTF8", @@ -48,7 +50,7 @@ "Acceptable values:", "1. 'DEFAULT' - when set to 'DEFAULT', Nmig will run 2 data-loader processes.", "2. Any positive integer.", - "Notice:", + "Note:", "1.", "Usually, migration gets accomplished faster with only 2 data-loader processes,", "even if more CPU cores are available.", diff --git a/package-lock.json b/package-lock.json index 30341925..993bde81 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,41 +1,41 @@ { "name": "nmig", - "version": "5.6.0", + "version": "5.7.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "nmig", - "version": "5.6.0", + "version": "5.7.0", "license": "GPL-3.0", "dependencies": { - "@types/node": "^17.0.16", - "@types/pg": "^8.6.4", - "@types/uuid": "^8.3.4", - "json2csv": "^5.0.6", - "mysql2": "^2.3.3", - "pg": "^8.7.3", - "pg-copy-streams": "^6.0.2", - "uuid": "^8.3.2" + "@types/node": "18.15.13", + "@types/pg": "8.6.6", + "@types/uuid": "9.0.1", + "json2csv": "5.0.7", + "mysql2": "3.2.3", + "pg": "8.10.0", + "pg-copy-streams": "6.0.5", + "uuid": "9.0.0" }, "devDependencies": { - "@types/tape": "^4.13.2", - "tape": "^5.5.0", - "typescript": "4.5.5" + "@types/tape": "4.13.4", + "tape": "5.6.3", + "typescript": "5.0.4" }, "engines": { "node": ">=10.0.0" } }, "node_modules/@types/node": { - "version": "17.0.42", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.42.tgz", - "integrity": "sha512-Q5BPGyGKcvQgAMbsr7qEGN/kIPN6zZecYYABeTDBizOsau+2NMdSVTar9UQw21A2+JyA2KRNDYaYrPB0Rpk2oQ==" + "version": "18.15.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", + "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==" }, "node_modules/@types/pg": { - "version": "8.6.5", - "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.5.tgz", - "integrity": "sha512-tOkGtAqRVkHa/PVZicq67zuujI4Oorfglsr2IbKofDwBSysnaqSx7W1mDqFqdkGE6Fbgh+PZAl0r/BWON/mozw==", + "version": "8.6.6", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.6.tgz", + "integrity": "sha512-O2xNmXebtwVekJDD+02udOncjVcMZQuTEQEMpKJ0ZRf5E7/9JJX3izhKUcUifBkyKpljyUM6BTgy2trmviKlpw==", "dependencies": { "@types/node": "*", "pg-protocol": "*", @@ -43,28 +43,38 @@ } }, "node_modules/@types/tape": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@types/tape/-/tape-4.13.2.tgz", - "integrity": "sha512-V1ez/RtYRGN9cNYApw5xf27DpMkTB0033X6a2i3KUmKhSojBfbWN0i3EgZxboUG96WJLHLdOyZ01aiZwVW5aSA==", + "version": "4.13.4", + "resolved": "https://registry.npmjs.org/@types/tape/-/tape-4.13.4.tgz", + "integrity": "sha512-0Mw8/FAMheD2MvyaFYDaAix7X5GfNjl/XI+zvqJdzC6N05BmHKz6Hwn+r7+8PEXDEKrC3V/irC9z7mrl5a130g==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/through": "*" + } + }, + "node_modules/@types/through": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/@types/through/-/through-0.0.30.tgz", + "integrity": "sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/uuid": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", - "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==" + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-rFT3ak0/2trgvp4yYZo5iKFEPsET7vKydKF+VRCxlQ9bpheehyAJH89dAkaLEq/j/RZXJIqcgsmPJKUP1Z28HA==" }, "node_modules/array.prototype.every": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/array.prototype.every/-/array.prototype.every-1.1.3.tgz", - "integrity": "sha512-vWnriJI//SOMOWtXbU/VXhJ/InfnNHPF6BLKn5WfY8xXy+NWql0fUy20GO3sdqBhCAO+qw8S/E5nJiZX+QFdCA==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/array.prototype.every/-/array.prototype.every-1.1.4.tgz", + "integrity": "sha512-Aui35iRZk1HHLRAyF7QP0KAnOnduaQ6fo6k1NVWfRc0xTs2AZ70ytlXvOmkC6Di4JmUs2Wv3DYzGtCQFSk5uGg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", "is-string": "^1.0.7" }, "engines": { @@ -138,26 +148,28 @@ "dev": true }, "node_modules/deep-equal": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.0.tgz", + "integrity": "sha512-RdpzE0Hv4lhowpIUKKMJfeH6C1pXdtT1/it80ubgWqwI3qpuxUBpC1S4hnHg+zjnuOoDkzUtUCEEkG+XG5l3Mw==", "dev": true, "dependencies": { - "call-bind": "^1.0.0", - "es-get-iterator": "^1.1.1", - "get-intrinsic": "^1.0.1", - "is-arguments": "^1.0.4", - "is-date-object": "^1.0.2", - "is-regex": "^1.1.1", + "call-bind": "^1.0.2", + "es-get-iterator": "^1.1.2", + "get-intrinsic": "^1.1.3", + "is-arguments": "^1.1.1", + "is-array-buffer": "^3.0.1", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", "isarray": "^2.0.5", - "object-is": "^1.1.4", + "object-is": "^1.1.5", "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "regexp.prototype.flags": "^1.3.0", - "side-channel": "^1.0.3", - "which-boxed-primitive": "^1.0.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.4.3", + "side-channel": "^1.0.4", + "which-boxed-primitive": "^1.0.2", "which-collection": "^1.0.1", - "which-typed-array": "^1.1.2" + "which-typed-array": "^1.1.9" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -180,15 +192,18 @@ } }, "node_modules/defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha512-Y2caI5+ZwS5c3RiNDJ6u53VhQHv+hHKwhkI1iHvceKUHw9Df6EK2zRLfjejRgMuCuxK7PfSWIMwWecceVvThjQ==", - "dev": true + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", + "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/denque": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/denque/-/denque-2.0.1.tgz", - "integrity": "sha512-tfiWc6BQLXNLpNiR5iGd0Ocu3P3VpxfzFiqubLgMfhfOw9WyvgJBd46CClNn9k3qfbjvT//0cf7AlYRX/OslMQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", "engines": { "node": ">=0.10" } @@ -206,34 +221,44 @@ } }, "node_modules/es-abstract": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.1.tgz", - "integrity": "sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA==", + "version": "1.21.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.1.tgz", + "integrity": "sha512-QudMsPOz86xYz/1dG1OuGBKOELjCh99IIWHLzy5znUB6j8xG2yMA7bfTV86VSqKF+Y/H08vQPR+9jyXpuC6hfg==", "dev": true, "dependencies": { + "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.1.1", + "get-intrinsic": "^1.1.3", "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", "has": "^1.0.3", "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", + "internal-slot": "^1.0.4", + "is-array-buffer": "^3.0.1", + "is-callable": "^1.2.7", "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", + "is-typed-array": "^1.1.10", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.0", + "object-inspect": "^1.12.2", "object-keys": "^1.1.1", - "object.assign": "^4.1.2", + "object.assign": "^4.1.4", "regexp.prototype.flags": "^1.4.3", - "string.prototype.trimend": "^1.0.5", - "string.prototype.trimstart": "^1.0.5", - "unbox-primitive": "^1.0.2" + "safe-regex-test": "^1.0.0", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.9" }, "engines": { "node": ">= 0.4" @@ -243,24 +268,39 @@ } }, "node_modules/es-get-iterator": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.2.tgz", - "integrity": "sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", + "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.0", - "has-symbols": "^1.0.1", - "is-arguments": "^1.1.0", + "get-intrinsic": "^1.1.3", + "has-symbols": "^1.0.3", + "is-arguments": "^1.1.1", "is-map": "^2.0.2", "is-set": "^2.0.2", - "is-string": "^1.0.5", - "isarray": "^2.0.5" + "is-string": "^1.0.7", + "isarray": "^2.0.5", + "stop-iteration-iterator": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -335,9 +375,9 @@ } }, "node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", + "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", "dev": true, "dependencies": { "function-bind": "^1.1.1", @@ -393,6 +433,33 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -439,6 +506,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -494,12 +573,12 @@ "dev": true }, "node_modules/internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.4.tgz", + "integrity": "sha512-tA8URYccNzMo94s5MQZgH8NB/XTa6HsOo0MLfXTKKEnHVVdegzaQoFZ7Jp44bdvLvY2waT5dc+j5ICEswhi7UQ==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.0", + "get-intrinsic": "^1.1.3", "has": "^1.0.3", "side-channel": "^1.0.4" }, @@ -523,6 +602,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-array-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.1.tgz", + "integrity": "sha512-ASfLknmY8Xa2XtB4wmbz13Wu202baeA18cJBCeCy0wXUHZF0IPyVEXqKEcd+t2fNSLLL1vC6k7lxZEojNbISXQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-typed-array": "^1.1.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", @@ -552,9 +645,9 @@ } }, "node_modules/is-callable": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, "engines": { "node": ">= 0.4" @@ -564,9 +657,9 @@ } }, "node_modules/is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -699,15 +792,15 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.9.tgz", - "integrity": "sha512-kfrlnTTn8pZkfpJMUgYD7YZ3qzeJgWUn8XfVYBARc4wnmNOmLbmuuaAs3q5fvB0UJOn6yHAKaGTPM7d6ezoD/A==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", + "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", - "es-abstract": "^1.20.0", "for-each": "^0.3.3", + "gopd": "^1.0.1", "has-tostringtag": "^1.0.0" }, "engines": { @@ -788,19 +881,16 @@ "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==" }, "node_modules/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz", + "integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A==" }, "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.14.1.tgz", + "integrity": "sha512-ysxwsnTKdAx96aTRdhDOCQfDgbHnt8SK0KY8SEjO0wHinhWOFTESbjVCMPbU1uGXg/ch4lifqx0wfjOawU2+WA==", "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/minimatch": { @@ -816,22 +906,25 @@ } }, "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/mysql2": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-2.3.3.tgz", - "integrity": "sha512-wxJUev6LgMSgACDkb/InIFxDprRa6T95+VEoR+xPvtngtccNH2dGjEB/fVZ8yg1gWv1510c9CvXuJHi5zUm0ZA==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.2.3.tgz", + "integrity": "sha512-aethLO9cSAGba9gOXzNayuyq2GAVTKc3vwr+uETOX1yjUuH6MS6D5ewhUqkaukmtjzrb5C9ML7YmmmRBjQ3r3Q==", "dependencies": { - "denque": "^2.0.1", + "denque": "^2.1.0", "generate-function": "^2.3.1", "iconv-lite": "^0.6.3", - "long": "^4.0.0", - "lru-cache": "^6.0.0", - "named-placeholders": "^1.1.2", + "long": "^5.2.1", + "lru-cache": "^8.0.0", + "named-placeholders": "^1.1.3", "seq-queue": "^0.0.5", "sqlstring": "^2.3.2" }, @@ -839,35 +932,29 @@ "node": ">= 8.0" } }, - "node_modules/named-placeholders": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.2.tgz", - "integrity": "sha512-wiFWqxoLL3PGVReSZpjLVxyJ1bRqe+KKJVbr4hGs1KWfTZTQyezHFBbuKj9hsizHyGV2ne7EMjHdxEGAybD5SA==", - "dependencies": { - "lru-cache": "^4.1.3" - }, + "node_modules/mysql2/node_modules/lru-cache": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz", + "integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==", "engines": { - "node": ">=6.0.0" + "node": ">=16.14" } }, - "node_modules/named-placeholders/node_modules/lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "node_modules/named-placeholders": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", "dependencies": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=12.0.0" } }, - "node_modules/named-placeholders/node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" - }, "node_modules/object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -899,14 +986,14 @@ } }, "node_modules/object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", "object-keys": "^1.1.1" }, "engines": { @@ -951,15 +1038,15 @@ "dev": true }, "node_modules/pg": { - "version": "8.7.3", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.7.3.tgz", - "integrity": "sha512-HPmH4GH4H3AOprDJOazoIcpI49XFsHCe8xlrjHkWiapdbHK+HLtbm/GQzXYAZwmPju/kzKhjaSfMACG+8cgJcw==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.10.0.tgz", + "integrity": "sha512-ke7o7qSTMb47iwzOSaZMfeR7xToFdkE71ifIipOAAaLIM0DYzfOAXlgFFmYUIE2BcJtvnVlGCID84ZzCegE8CQ==", "dependencies": { "buffer-writer": "2.0.0", "packet-reader": "1.0.0", "pg-connection-string": "^2.5.0", - "pg-pool": "^3.5.1", - "pg-protocol": "^1.5.0", + "pg-pool": "^3.6.0", + "pg-protocol": "^1.6.0", "pg-types": "^2.1.0", "pgpass": "1.x" }, @@ -967,7 +1054,7 @@ "node": ">= 8.0.0" }, "peerDependencies": { - "pg-native": ">=2.0.0" + "pg-native": ">=3.0.1" }, "peerDependenciesMeta": { "pg-native": { @@ -981,9 +1068,9 @@ "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" }, "node_modules/pg-copy-streams": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/pg-copy-streams/-/pg-copy-streams-6.0.2.tgz", - "integrity": "sha512-74doDsDUI3ti1IzeieA7c/VsTpZkBdgjMeag3BtJFV+3J0m7Z3UMJB8iQW+zUWHZGVF9d/WIRfledEaPfKcPEA==", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/pg-copy-streams/-/pg-copy-streams-6.0.5.tgz", + "integrity": "sha512-HcjUCaeEputOnSTgRQrkUkOKEBtyfcXsrrf6FA7z6AgesRxR35GRovk5Akw1LYRNwSFYpc9XVVxLrxYCWwNHMg==", "dependencies": { "obuf": "^1.1.2" } @@ -997,17 +1084,17 @@ } }, "node_modules/pg-pool": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.5.1.tgz", - "integrity": "sha512-6iCR0wVrro6OOHFsyavV+i6KYL4lVNyYAB9RD18w66xSzN+d8b66HiwuP30Gp1SH5O9T82fckkzsRjlrhD0ioQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.0.tgz", + "integrity": "sha512-clFRf2ksqd+F497kWFyM21tMjeikn60oGDmqMT8UBrynEwVEX/5R5xd2sdvdo1cZCFlguORNpVuqxIj+aK4cfQ==", "peerDependencies": { "pg": ">=8.0" } }, "node_modules/pg-protocol": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.5.0.tgz", - "integrity": "sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ==" + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.0.tgz", + "integrity": "sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==" }, "node_modules/pg-types": { "version": "2.2.0", @@ -1067,11 +1154,6 @@ "node": ">=0.10.0" } }, - "node_modules/pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" - }, "node_modules/regexp.prototype.flags": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", @@ -1090,13 +1172,17 @@ } }, "node_modules/resolve": { - "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", + "version": "2.0.0-next.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", + "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", "dev": true, "dependencies": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1111,6 +1197,20 @@ "through": "~2.3.4" } }, + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -1151,15 +1251,27 @@ "node": ">= 0.6" } }, + "node_modules/stop-iteration-iterator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", + "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", + "dev": true, + "dependencies": { + "internal-slot": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/string.prototype.trim": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.6.tgz", - "integrity": "sha512-8lMR2m+U0VJTPp6JjvJTtGyc4FIGq9CdRt7O9p6T0e6K4vjU+OP+SQJpbe/SBmRcCUIvNUnjsbmY6lnMp8MhsQ==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", + "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" + "es-abstract": "^1.20.4" }, "engines": { "node": ">= 0.4" @@ -1169,63 +1281,78 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", - "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", + "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" + "es-abstract": "^1.20.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", - "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", + "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" + "es-abstract": "^1.20.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.6.3.tgz", + "integrity": "sha512-cUDDGSbyoSIpdUAqbqLI/r7i/S4BHuCB9M5j7E/LrLs/x/i4zeAJ798aqo+FGo+kr9seBZwr8AkZW6rjceyAMQ==", "dev": true, "dependencies": { - "array.prototype.every": "^1.1.3", + "array.prototype.every": "^1.1.4", "call-bind": "^1.0.2", - "deep-equal": "^2.0.5", - "defined": "^1.0.0", + "deep-equal": "^2.2.0", + "defined": "^1.0.1", "dotignore": "^0.1.2", "for-each": "^0.3.3", "get-package-type": "^0.1.0", - "glob": "^7.2.0", + "glob": "^7.2.3", "has": "^1.0.3", "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", - "object-inspect": "^1.12.0", + "minimist": "^1.2.7", + "object-inspect": "^1.12.3", "object-is": "^1.1.5", "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "resolve": "^2.0.0-next.3", + "object.assign": "^4.1.4", + "resolve": "^2.0.0-next.4", "resumer": "^0.0.0", - "string.prototype.trim": "^1.2.5", + "string.prototype.trim": "^1.2.7", "through": "^2.3.8" }, "bin": { "tape": "bin/tape" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/through": { @@ -1234,17 +1361,31 @@ "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "dev": true }, + "node_modules/typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typescript": { - "version": "4.5.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", - "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=12.20" } }, "node_modules/unbox-primitive": { @@ -1263,9 +1404,9 @@ } }, "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", "bin": { "uuid": "dist/bin/uuid" } @@ -1302,17 +1443,17 @@ } }, "node_modules/which-typed-array": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.8.tgz", - "integrity": "sha512-Jn4e5PItbcAHyLoRDwvPj1ypu27DJbtdYXUa5zsinrUx77Uvfb0cXwwnGMTn7cjUfhhqgVQnVJCwF+7cgU7tpw==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", + "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", - "es-abstract": "^1.20.0", "for-each": "^0.3.3", + "gopd": "^1.0.1", "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.9" + "is-typed-array": "^1.1.10" }, "engines": { "node": ">= 0.4" @@ -1334,23 +1475,18 @@ "engines": { "node": ">=0.4" } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" } }, "dependencies": { "@types/node": { - "version": "17.0.42", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.42.tgz", - "integrity": "sha512-Q5BPGyGKcvQgAMbsr7qEGN/kIPN6zZecYYABeTDBizOsau+2NMdSVTar9UQw21A2+JyA2KRNDYaYrPB0Rpk2oQ==" + "version": "18.15.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", + "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==" }, "@types/pg": { - "version": "8.6.5", - "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.5.tgz", - "integrity": "sha512-tOkGtAqRVkHa/PVZicq67zuujI4Oorfglsr2IbKofDwBSysnaqSx7W1mDqFqdkGE6Fbgh+PZAl0r/BWON/mozw==", + "version": "8.6.6", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.6.tgz", + "integrity": "sha512-O2xNmXebtwVekJDD+02udOncjVcMZQuTEQEMpKJ0ZRf5E7/9JJX3izhKUcUifBkyKpljyUM6BTgy2trmviKlpw==", "requires": { "@types/node": "*", "pg-protocol": "*", @@ -1358,28 +1494,38 @@ } }, "@types/tape": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@types/tape/-/tape-4.13.2.tgz", - "integrity": "sha512-V1ez/RtYRGN9cNYApw5xf27DpMkTB0033X6a2i3KUmKhSojBfbWN0i3EgZxboUG96WJLHLdOyZ01aiZwVW5aSA==", + "version": "4.13.4", + "resolved": "https://registry.npmjs.org/@types/tape/-/tape-4.13.4.tgz", + "integrity": "sha512-0Mw8/FAMheD2MvyaFYDaAix7X5GfNjl/XI+zvqJdzC6N05BmHKz6Hwn+r7+8PEXDEKrC3V/irC9z7mrl5a130g==", + "dev": true, + "requires": { + "@types/node": "*", + "@types/through": "*" + } + }, + "@types/through": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/@types/through/-/through-0.0.30.tgz", + "integrity": "sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg==", "dev": true, "requires": { "@types/node": "*" } }, "@types/uuid": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", - "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==" + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-rFT3ak0/2trgvp4yYZo5iKFEPsET7vKydKF+VRCxlQ9bpheehyAJH89dAkaLEq/j/RZXJIqcgsmPJKUP1Z28HA==" }, "array.prototype.every": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/array.prototype.every/-/array.prototype.every-1.1.3.tgz", - "integrity": "sha512-vWnriJI//SOMOWtXbU/VXhJ/InfnNHPF6BLKn5WfY8xXy+NWql0fUy20GO3sdqBhCAO+qw8S/E5nJiZX+QFdCA==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/array.prototype.every/-/array.prototype.every-1.1.4.tgz", + "integrity": "sha512-Aui35iRZk1HHLRAyF7QP0KAnOnduaQ6fo6k1NVWfRc0xTs2AZ70ytlXvOmkC6Di4JmUs2Wv3DYzGtCQFSk5uGg==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", "is-string": "^1.0.7" } }, @@ -1432,26 +1578,28 @@ "dev": true }, "deep-equal": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.0.tgz", + "integrity": "sha512-RdpzE0Hv4lhowpIUKKMJfeH6C1pXdtT1/it80ubgWqwI3qpuxUBpC1S4hnHg+zjnuOoDkzUtUCEEkG+XG5l3Mw==", "dev": true, "requires": { - "call-bind": "^1.0.0", - "es-get-iterator": "^1.1.1", - "get-intrinsic": "^1.0.1", - "is-arguments": "^1.0.4", - "is-date-object": "^1.0.2", - "is-regex": "^1.1.1", + "call-bind": "^1.0.2", + "es-get-iterator": "^1.1.2", + "get-intrinsic": "^1.1.3", + "is-arguments": "^1.1.1", + "is-array-buffer": "^3.0.1", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", "isarray": "^2.0.5", - "object-is": "^1.1.4", + "object-is": "^1.1.5", "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "regexp.prototype.flags": "^1.3.0", - "side-channel": "^1.0.3", - "which-boxed-primitive": "^1.0.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.4.3", + "side-channel": "^1.0.4", + "which-boxed-primitive": "^1.0.2", "which-collection": "^1.0.1", - "which-typed-array": "^1.1.2" + "which-typed-array": "^1.1.9" } }, "define-properties": { @@ -1465,15 +1613,15 @@ } }, "defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha512-Y2caI5+ZwS5c3RiNDJ6u53VhQHv+hHKwhkI1iHvceKUHw9Df6EK2zRLfjejRgMuCuxK7PfSWIMwWecceVvThjQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", + "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==", "dev": true }, "denque": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/denque/-/denque-2.0.1.tgz", - "integrity": "sha512-tfiWc6BQLXNLpNiR5iGd0Ocu3P3VpxfzFiqubLgMfhfOw9WyvgJBd46CClNn9k3qfbjvT//0cf7AlYRX/OslMQ==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==" }, "dotignore": { "version": "0.1.2", @@ -1485,50 +1633,72 @@ } }, "es-abstract": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.1.tgz", - "integrity": "sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA==", + "version": "1.21.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.1.tgz", + "integrity": "sha512-QudMsPOz86xYz/1dG1OuGBKOELjCh99IIWHLzy5znUB6j8xG2yMA7bfTV86VSqKF+Y/H08vQPR+9jyXpuC6hfg==", "dev": true, "requires": { + "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.1.1", + "get-intrinsic": "^1.1.3", "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", "has": "^1.0.3", "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", + "internal-slot": "^1.0.4", + "is-array-buffer": "^3.0.1", + "is-callable": "^1.2.7", "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", + "is-typed-array": "^1.1.10", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.0", + "object-inspect": "^1.12.2", "object-keys": "^1.1.1", - "object.assign": "^4.1.2", + "object.assign": "^4.1.4", "regexp.prototype.flags": "^1.4.3", - "string.prototype.trimend": "^1.0.5", - "string.prototype.trimstart": "^1.0.5", - "unbox-primitive": "^1.0.2" + "safe-regex-test": "^1.0.0", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.9" } }, "es-get-iterator": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.2.tgz", - "integrity": "sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", + "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", "dev": true, "requires": { "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.0", - "has-symbols": "^1.0.1", - "is-arguments": "^1.1.0", + "get-intrinsic": "^1.1.3", + "has-symbols": "^1.0.3", + "is-arguments": "^1.1.1", "is-map": "^2.0.2", "is-set": "^2.0.2", - "is-string": "^1.0.5", - "isarray": "^2.0.5" + "is-string": "^1.0.7", + "isarray": "^2.0.5", + "stop-iteration-iterator": "^1.0.0" + } + }, + "es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" } }, "es-to-primitive": { @@ -1590,9 +1760,9 @@ } }, "get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", + "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", "dev": true, "requires": { "function-bind": "^1.1.1", @@ -1630,6 +1800,24 @@ "path-is-absolute": "^1.0.0" } }, + "globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3" + } + }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3" + } + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -1664,6 +1852,12 @@ "get-intrinsic": "^1.1.1" } }, + "has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true + }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -1704,12 +1898,12 @@ "dev": true }, "internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.4.tgz", + "integrity": "sha512-tA8URYccNzMo94s5MQZgH8NB/XTa6HsOo0MLfXTKKEnHVVdegzaQoFZ7Jp44bdvLvY2waT5dc+j5ICEswhi7UQ==", "dev": true, "requires": { - "get-intrinsic": "^1.1.0", + "get-intrinsic": "^1.1.3", "has": "^1.0.3", "side-channel": "^1.0.4" } @@ -1724,6 +1918,17 @@ "has-tostringtag": "^1.0.0" } }, + "is-array-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.1.tgz", + "integrity": "sha512-ASfLknmY8Xa2XtB4wmbz13Wu202baeA18cJBCeCy0wXUHZF0IPyVEXqKEcd+t2fNSLLL1vC6k7lxZEojNbISXQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-typed-array": "^1.1.10" + } + }, "is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", @@ -1744,15 +1949,15 @@ } }, "is-callable": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true }, "is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", "dev": true, "requires": { "has": "^1.0.3" @@ -1837,15 +2042,15 @@ } }, "is-typed-array": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.9.tgz", - "integrity": "sha512-kfrlnTTn8pZkfpJMUgYD7YZ3qzeJgWUn8XfVYBARc4wnmNOmLbmuuaAs3q5fvB0UJOn6yHAKaGTPM7d6ezoD/A==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", + "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", "dev": true, "requires": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", - "es-abstract": "^1.20.0", "for-each": "^0.3.3", + "gopd": "^1.0.1", "has-tostringtag": "^1.0.0" } }, @@ -1901,17 +2106,14 @@ "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==" }, "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz", + "integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A==" }, "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.14.1.tgz", + "integrity": "sha512-ysxwsnTKdAx96aTRdhDOCQfDgbHnt8SK0KY8SEjO0wHinhWOFTESbjVCMPbU1uGXg/ch4lifqx0wfjOawU2+WA==" }, "minimatch": { "version": "3.1.2", @@ -1923,54 +2125,45 @@ } }, "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", "dev": true }, "mysql2": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-2.3.3.tgz", - "integrity": "sha512-wxJUev6LgMSgACDkb/InIFxDprRa6T95+VEoR+xPvtngtccNH2dGjEB/fVZ8yg1gWv1510c9CvXuJHi5zUm0ZA==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.2.3.tgz", + "integrity": "sha512-aethLO9cSAGba9gOXzNayuyq2GAVTKc3vwr+uETOX1yjUuH6MS6D5ewhUqkaukmtjzrb5C9ML7YmmmRBjQ3r3Q==", "requires": { - "denque": "^2.0.1", + "denque": "^2.1.0", "generate-function": "^2.3.1", "iconv-lite": "^0.6.3", - "long": "^4.0.0", - "lru-cache": "^6.0.0", - "named-placeholders": "^1.1.2", + "long": "^5.2.1", + "lru-cache": "^8.0.0", + "named-placeholders": "^1.1.3", "seq-queue": "^0.0.5", "sqlstring": "^2.3.2" - } - }, - "named-placeholders": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.2.tgz", - "integrity": "sha512-wiFWqxoLL3PGVReSZpjLVxyJ1bRqe+KKJVbr4hGs1KWfTZTQyezHFBbuKj9hsizHyGV2ne7EMjHdxEGAybD5SA==", - "requires": { - "lru-cache": "^4.1.3" }, "dependencies": { "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz", + "integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==" } } }, + "named-placeholders": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", + "requires": { + "lru-cache": "^7.14.1" + } + }, "object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", "dev": true }, "object-is": { @@ -1990,14 +2183,14 @@ "dev": true }, "object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", "dev": true, "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", "object-keys": "^1.1.1" } }, @@ -2033,15 +2226,15 @@ "dev": true }, "pg": { - "version": "8.7.3", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.7.3.tgz", - "integrity": "sha512-HPmH4GH4H3AOprDJOazoIcpI49XFsHCe8xlrjHkWiapdbHK+HLtbm/GQzXYAZwmPju/kzKhjaSfMACG+8cgJcw==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.10.0.tgz", + "integrity": "sha512-ke7o7qSTMb47iwzOSaZMfeR7xToFdkE71ifIipOAAaLIM0DYzfOAXlgFFmYUIE2BcJtvnVlGCID84ZzCegE8CQ==", "requires": { "buffer-writer": "2.0.0", "packet-reader": "1.0.0", "pg-connection-string": "^2.5.0", - "pg-pool": "^3.5.1", - "pg-protocol": "^1.5.0", + "pg-pool": "^3.6.0", + "pg-protocol": "^1.6.0", "pg-types": "^2.1.0", "pgpass": "1.x" } @@ -2052,9 +2245,9 @@ "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" }, "pg-copy-streams": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/pg-copy-streams/-/pg-copy-streams-6.0.2.tgz", - "integrity": "sha512-74doDsDUI3ti1IzeieA7c/VsTpZkBdgjMeag3BtJFV+3J0m7Z3UMJB8iQW+zUWHZGVF9d/WIRfledEaPfKcPEA==", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/pg-copy-streams/-/pg-copy-streams-6.0.5.tgz", + "integrity": "sha512-HcjUCaeEputOnSTgRQrkUkOKEBtyfcXsrrf6FA7z6AgesRxR35GRovk5Akw1LYRNwSFYpc9XVVxLrxYCWwNHMg==", "requires": { "obuf": "^1.1.2" } @@ -2065,15 +2258,15 @@ "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==" }, "pg-pool": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.5.1.tgz", - "integrity": "sha512-6iCR0wVrro6OOHFsyavV+i6KYL4lVNyYAB9RD18w66xSzN+d8b66HiwuP30Gp1SH5O9T82fckkzsRjlrhD0ioQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.0.tgz", + "integrity": "sha512-clFRf2ksqd+F497kWFyM21tMjeikn60oGDmqMT8UBrynEwVEX/5R5xd2sdvdo1cZCFlguORNpVuqxIj+aK4cfQ==", "requires": {} }, "pg-protocol": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.5.0.tgz", - "integrity": "sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ==" + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.0.tgz", + "integrity": "sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==" }, "pg-types": { "version": "2.2.0", @@ -2118,11 +2311,6 @@ "xtend": "^4.0.0" } }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" - }, "regexp.prototype.flags": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", @@ -2135,13 +2323,14 @@ } }, "resolve": { - "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", + "version": "2.0.0-next.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", + "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", "dev": true, "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" } }, "resumer": { @@ -2153,6 +2342,17 @@ "through": "~2.3.4" } }, + "safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + } + }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -2184,65 +2384,80 @@ "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==" }, + "stop-iteration-iterator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", + "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", + "dev": true, + "requires": { + "internal-slot": "^1.0.4" + } + }, "string.prototype.trim": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.6.tgz", - "integrity": "sha512-8lMR2m+U0VJTPp6JjvJTtGyc4FIGq9CdRt7O9p6T0e6K4vjU+OP+SQJpbe/SBmRcCUIvNUnjsbmY6lnMp8MhsQ==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", + "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" + "es-abstract": "^1.20.4" } }, "string.prototype.trimend": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", - "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", + "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" + "es-abstract": "^1.20.4" } }, "string.prototype.trimstart": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", - "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", + "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" + "es-abstract": "^1.20.4" } }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, "tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.6.3.tgz", + "integrity": "sha512-cUDDGSbyoSIpdUAqbqLI/r7i/S4BHuCB9M5j7E/LrLs/x/i4zeAJ798aqo+FGo+kr9seBZwr8AkZW6rjceyAMQ==", "dev": true, "requires": { - "array.prototype.every": "^1.1.3", + "array.prototype.every": "^1.1.4", "call-bind": "^1.0.2", - "deep-equal": "^2.0.5", - "defined": "^1.0.0", + "deep-equal": "^2.2.0", + "defined": "^1.0.1", "dotignore": "^0.1.2", "for-each": "^0.3.3", "get-package-type": "^0.1.0", - "glob": "^7.2.0", + "glob": "^7.2.3", "has": "^1.0.3", "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", - "object-inspect": "^1.12.0", + "minimist": "^1.2.7", + "object-inspect": "^1.12.3", "object-is": "^1.1.5", "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "resolve": "^2.0.0-next.3", + "object.assign": "^4.1.4", + "resolve": "^2.0.0-next.4", "resumer": "^0.0.0", - "string.prototype.trim": "^1.2.5", + "string.prototype.trim": "^1.2.7", "through": "^2.3.8" } }, @@ -2252,10 +2467,21 @@ "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "dev": true }, + "typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + } + }, "typescript": { - "version": "4.5.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", - "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true }, "unbox-primitive": { @@ -2271,9 +2497,9 @@ } }, "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" }, "which-boxed-primitive": { "version": "1.0.2", @@ -2301,17 +2527,17 @@ } }, "which-typed-array": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.8.tgz", - "integrity": "sha512-Jn4e5PItbcAHyLoRDwvPj1ypu27DJbtdYXUa5zsinrUx77Uvfb0cXwwnGMTn7cjUfhhqgVQnVJCwF+7cgU7tpw==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", + "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", "dev": true, "requires": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", - "es-abstract": "^1.20.0", "for-each": "^0.3.3", + "gopd": "^1.0.1", "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.9" + "is-typed-array": "^1.1.10" } }, "wrappy": { @@ -2324,11 +2550,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" } } } diff --git a/package.json b/package.json index 3fd53c2e..5fb52890 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nmig", - "version": "5.6.0", + "version": "5.7.0", "description": "The database migration app", "author": "Anatoly Khaytovich", "license": "GPL-3.0", @@ -12,19 +12,19 @@ "node": ">=10.0.0" }, "dependencies": { - "@types/node": "^17.0.16", - "@types/pg": "^8.6.4", - "@types/uuid": "^8.3.4", - "json2csv": "^5.0.6", - "mysql2": "^2.3.3", - "pg": "^8.7.3", - "pg-copy-streams": "^6.0.2", - "uuid": "^8.3.2" + "@types/node": "18.15.13", + "@types/pg": "8.6.6", + "@types/uuid": "9.0.1", + "json2csv": "5.0.7", + "mysql2": "3.2.3", + "pg": "8.10.0", + "pg-copy-streams": "6.0.5", + "uuid": "9.0.0" }, "devDependencies": { - "@types/tape": "^4.13.2", - "tape": "^5.5.0", - "typescript": "4.5.5" + "@types/tape": "4.13.4", + "tape": "5.6.3", + "typescript": "5.0.4" }, "scripts": { "build": "tsc --incremental -p tsconfig.json", diff --git a/src/BinaryDataDecoder.ts b/src/BinaryDataDecoder.ts index 571763b3..46e63a98 100644 --- a/src/BinaryDataDecoder.ts +++ b/src/BinaryDataDecoder.ts @@ -46,14 +46,14 @@ export default async (conversion: Conversion): Promise => { sql: sql, vendor: DBVendors.PG, processExitOnError: false, - shouldReturnClient: false + shouldReturnClient: false, }; const result: DBAccessQueryResult = await DBAccess.query(params); if (result.error) { // No need to continue if no 'bytea' or 'geometry' columns found. - await DBAccess.releaseDbClient(conversion, result.client); + DBAccess.releaseDbClient(conversion, result.client); return conversion; } diff --git a/src/BootProcessor.ts b/src/BootProcessor.ts index af9e0c2e..54131738 100644 --- a/src/BootProcessor.ts +++ b/src/BootProcessor.ts @@ -75,7 +75,7 @@ export const boot = async (conversion: Conversion): Promise => { const logTitle: string = 'BootProcessor::boot'; if (connectionErrorMessage) { - await generateError(conversion, `\t--[${ logTitle }]\n ${ logo } \n ${ connectionErrorMessage }`); + generateError(conversion, `\t--[${ logTitle }]\n ${ logo } \n ${ connectionErrorMessage }`); process.exit(1); } diff --git a/src/ColumnsDataArranger.ts b/src/ColumnsDataArranger.ts index 5700de29..c34c034c 100644 --- a/src/ColumnsDataArranger.ts +++ b/src/ColumnsDataArranger.ts @@ -33,23 +33,17 @@ const isSpacial = (type: string): boolean => { /** * Defines if given type is one of MySQL binary types. */ -const isBinary = (type: string): boolean => { - return type.indexOf('blob') !== -1 || type.indexOf('binary') !== -1; -}; +const isBinary = (type: string): boolean => type.indexOf('blob') !== -1 || type.indexOf('binary') !== -1; /** * Defines if given type is one of MySQL bit types. */ -const isBit = (type: string): boolean => { - return type.indexOf('bit') !== -1; -}; +const isBit = (type: string): boolean => type.indexOf('bit') !== -1; /** * Defines if given type is one of MySQL date-time types. */ -const isDateTime = (type: string): boolean => { - return type.indexOf('timestamp') !== -1 || type.indexOf('date') !== -1; -}; +const isDateTime = (type: string): boolean => type.indexOf('timestamp') !== -1 || type.indexOf('date') !== -1; /** * Defines if given type is one of MySQL numeric types. @@ -63,16 +57,24 @@ const isNumeric = (type: string): boolean => { || type.indexOf('point') !== -1; }; +/** + * Returns type name, while dropping unnecessary parts. + * Sample: + * 1. "enum" instead of "enum('val1','val2','val3')". + * 2. "int" instead of "int(11)". + */ +const getSanitizedType = (type: string): string => type.split('(')[0]; + /** * Arranges columns data before loading. */ -export default (arrTableColumns: any[], mysqlVersion: string | number, encoding: Encoding): string => { +export default (arrTableColumns: any[], mysqlVersion: number, encoding: Encoding): string => { let strRetVal: string = ''; const wkbFunc: string = mysqlVersion >= 5.76 ? 'ST_AsWKB' : 'AsWKB'; arrTableColumns.forEach((column: any) => { const field: string = column.Field; - const type: string = column.Type; + const type: string = getSanitizedType(column.Type); if (isSpacial(type)) { // Apply HEX(ST_AsWKB(...)) due to the issue, described at https://bugs.mysql.com/bug.php?id=69798 diff --git a/src/Conversion.ts b/src/Conversion.ts index 18dfc895..973d6304 100644 --- a/src/Conversion.ts +++ b/src/Conversion.ts @@ -20,11 +20,14 @@ */ import * as path from 'path'; import { EventEmitter } from 'events'; +import { ChildProcess, fork } from 'child_process'; import { Pool as MySQLPool } from 'mysql2'; import { Pool as PgPool } from 'pg'; import { Encoding } from './Encoding'; +import { LogMessage } from './LogMessage'; +import { LogMessageType } from './LogMessageType'; export default class Conversion { /** @@ -120,7 +123,7 @@ export default class Conversion { /** * Current version of source (MySQL) db. */ - public _mysqlVersion: string | number; + public _mysqlVersion: string; /** * Node-MySQL connections pool. @@ -208,11 +211,18 @@ export default class Conversion { */ public readonly _numberOfSimultaneouslyRunningLoaderProcesses: string | number; + /** + * Logger is implemented as a child process. + * Note, here we hold only a reference to the logger process. + */ + public logger?: ChildProcess; + /** * Constructor. */ - public constructor(config: any) { + public constructor(config: any, avoidLogger: boolean = false) { this._config = config; + this.logger = avoidLogger ? undefined : this._setLogger(); this._sourceConString = this._config.source; this._targetConString = this._config.target; this._logsDirPath = this._config.logsDirPath; @@ -276,21 +286,47 @@ export default class Conversion { /** * Checks if there are actions to take other than data migration. */ - public shouldMigrateOnlyData(): boolean { - return this._migrateOnlyData; - } + public shouldMigrateOnlyData = (): boolean => this._migrateOnlyData; /** * Checks if given value is integer number. */ - private static _isIntNumeric(value: any): boolean { - return !isNaN(parseInt(value)) && isFinite(value); - } + private static _isIntNumeric = (value: any): boolean => !isNaN(parseInt(value)) && isFinite(value); /** * Initializes Conversion instance. */ - public static initializeConversion(config: any): Promise { - return Promise.resolve(new Conversion(config)); - } + public static initializeConversion = (config: any): Promise => Promise.resolve(new Conversion(config)); + + /** + * Starts a new logger process. + */ + private _setLogger = (): ChildProcess => { + // A path to the FsOps.js file. + // !!!Notice, in runtime it points to ../dist/src/LogsProcessor.js and not LogsProcessor.ts + const loggerPath: string = path.join(__dirname, 'LogsProcessor.js'); + + const logger: ChildProcess = fork(loggerPath) + .on('error', (err: Error) => console.log(`\t--[_setLogger] Error: ${ JSON.stringify(err) }`)) + .on('exit', (code: number | null) => { + console.log(`\t--[_setLogger] Process exited with code: ${ code || 'exit-code unknown' }`); + + if (code !== 0) { + console.log('\t--[_setLogger] Restarting logging process...'); + this.logger = this._setLogger(); + } + }); + + logger.send( + new LogMessage( + LogMessageType.CONFIG, + undefined, + undefined, + undefined, + this._config, + ) + ); + + return logger; + }; } diff --git a/src/DBAccess.ts b/src/DBAccess.ts index 4e1c9b11..a1ef301f 100644 --- a/src/DBAccess.ts +++ b/src/DBAccess.ts @@ -32,53 +32,53 @@ export default class DBAccess { /** * Ensures MySQL connection pool existence. */ - private static async _getMysqlConnection(conversion: Conversion): Promise { + private static _getMysqlConnection = (conversion: Conversion): void => { if (!conversion._mysql) { conversion._sourceConString.connectionLimit = conversion._maxEachDbConnectionPoolSize; conversion._sourceConString.multipleStatements = true; const pool: MySQLPool = mysql.createPool(conversion._sourceConString); if (!pool) { - await generateError(conversion, '\t--[getMysqlConnection] Cannot connect to MySQL server...'); + generateError(conversion, '\t--[getMysqlConnection] Cannot connect to MySQL server...'); process.exit(1); } conversion._mysql = pool; } - } + }; /** * Ensures PostgreSQL connection pool existence. */ - private static async _getPgConnection(conversion: Conversion): Promise { + private static _getPgConnection = (conversion: Conversion): void => { if (!conversion._pg) { conversion._targetConString.max = conversion._maxEachDbConnectionPoolSize; const pool: PgPool = new PgPool(conversion._targetConString); if (!pool) { - await generateError(conversion, '\t--[getPgConnection] Cannot connect to PostgreSQL server...'); + generateError(conversion, '\t--[getPgConnection] Cannot connect to PostgreSQL server...'); process.exit(1); } conversion._pg = pool; - conversion._pg.on('error', async (error: Error) => { + conversion._pg.on('error', (error: Error) => { const message: string = `Cannot connect to PostgreSQL server...\n' ${ error.message }\n${ error.stack }`; - await generateError(conversion, message); + generateError(conversion, message); }); } - } + }; /** * Closes both connection-pools. */ - public static async closeConnectionPools(conversion: Conversion): Promise { + public static closeConnectionPools = async (conversion: Conversion): Promise => { const closeMySqlConnections = (): Promise => { return new Promise(resolve => { if (conversion._mysql) { - conversion._mysql.end(async error => { + conversion._mysql.end(error => { if (error) { - await generateError(conversion, `\t--[DBAccess::closeConnectionPools] ${ error }`); + generateError(conversion, `\t--[DBAccess::closeConnectionPools] ${ error }`); } return resolve(); @@ -94,7 +94,7 @@ export default class DBAccess { try { await conversion._pg.end(); } catch (error) { - await generateError(conversion, `\t--[DBAccess::closeConnectionPools] ${ error }`); + generateError(conversion, `\t--[DBAccess::closeConnectionPools] ${ error }`); } } }; @@ -102,59 +102,63 @@ export default class DBAccess { await Promise.all([closeMySqlConnections, closePgConnections]); log(conversion, `\t--[DBAccess::closeConnectionPools] Closed all DB connections.`); return conversion; - } + }; /** * Obtains PoolConnection instance. */ - public static getMysqlClient(conversion: Conversion): Promise { - return new Promise(async (resolve, reject) => { - await DBAccess._getMysqlConnection(conversion); + public static getMysqlClient = (conversion: Conversion): Promise => { + return new Promise((resolve, reject) => { + DBAccess._getMysqlConnection(conversion); + (conversion._mysql).getConnection((err: NodeJS.ErrnoException | null, connection: PoolConnection) => { return err ? reject(err) : resolve(connection); }); }); - } + }; /** * Obtains PoolClient instance. */ - public static async getPgClient(conversion: Conversion): Promise { - await DBAccess._getPgConnection(conversion); - return (conversion._pg).connect(); - } + public static getPgClient = async (conversion: Conversion): Promise => { + DBAccess._getPgConnection(conversion); + return await (conversion._pg).connect(); + }; /** * Releases MySQL or PostgreSQL connection back to appropriate pool. */ - public static async releaseDbClient(conversion: Conversion, dbClient?: PoolConnection | PoolClient): Promise { + public static releaseDbClient = ( + conversion: Conversion, + dbClient?: PoolConnection | PoolClient, + ): void => { try { (dbClient).release(); dbClient = undefined; } catch (error) { - await generateError(conversion, `\t--[DBAccess::releaseDbClient] ${ error }`); + generateError(conversion, `\t--[DBAccess::releaseDbClient] ${ error }`); } - } + }; /** * Checks if there are no more queries to be sent using current client. * In such case the client should be released. */ - private static async _releaseDbClientIfNecessary( + private static _releaseDbClientIfNecessary = ( conversion: Conversion, client: PoolConnection | PoolClient, shouldHoldClient: boolean - ): Promise { + ): void => { if (!shouldHoldClient) { - await this.releaseDbClient(conversion, client); + this.releaseDbClient(conversion, client); } - } + }; /** * Sends given SQL query to specified DB. * Performs appropriate actions (requesting/releasing client) against target connections pool. */ - public static async query(queryParams: IDBAccessQueryParams): Promise { + public static query = async (queryParams: IDBAccessQueryParams): Promise => { let { conversion, caller, sql, vendor, processExitOnError, shouldReturnClient, client, bindings } = queryParams; // Checks if there is an available client. @@ -162,23 +166,46 @@ export default class DBAccess { try { // Client is undefined. // It must be requested from the connections pool. - client = vendor === DBVendors.PG ? await DBAccess.getPgClient(conversion) : await DBAccess.getMysqlClient(conversion); + client = vendor === DBVendors.PG + ? await DBAccess.getPgClient(conversion) + : await DBAccess.getMysqlClient(conversion); } catch (error) { // An error occurred when tried to obtain a client from one of pools. - await generateError(conversion, `\t--[${ caller }] ${ error }`, sql); - return processExitOnError ? process.exit(1) : new DBAccessQueryResult(client, undefined, error); + generateError(conversion, `\t--[${ caller }] ${ error }`, sql); + + return processExitOnError + ? process.exit(1) + : new DBAccessQueryResult(client, undefined, error); } } - return vendor === DBVendors.PG - ? DBAccess._queryPG(conversion, caller, sql, processExitOnError, shouldReturnClient, (client), bindings) - : DBAccess._queryMySQL(conversion, caller, sql, processExitOnError, shouldReturnClient, (client), bindings); - } + if (vendor === DBVendors.PG) { + return await DBAccess._queryPG( + conversion, + caller, + sql, + processExitOnError, + shouldReturnClient, + (client), + bindings, + ); + } + + return await DBAccess._queryMySQL( + conversion, + caller, + sql, + processExitOnError, + shouldReturnClient, + (client), + bindings, + ); + }; /** * Sends given SQL query to MySQL. */ - private static _queryMySQL( + private static _queryMySQL = ( conversion: Conversion, caller: string, sql: string, @@ -186,29 +213,29 @@ export default class DBAccess { shouldReturnClient: boolean, client?: PoolConnection, bindings?: any[] - ): Promise { + ): Promise => { return new Promise((resolve, reject) => { if (Array.isArray(bindings)) { sql = (client).format(sql, bindings); } - (client).query(sql, async (error: NodeJS.ErrnoException | null, data: any) => { - await DBAccess._releaseDbClientIfNecessary(conversion, (client), shouldReturnClient); + (client).query(sql, (error: NodeJS.ErrnoException | null, data: any) => { + DBAccess._releaseDbClientIfNecessary(conversion, (client), shouldReturnClient); if (error) { - await generateError(conversion, `\t--[${ caller }] ${ error }`, sql); + generateError(conversion, `\t--[${ caller }] ${ error }`, sql); return processExitOnError ? process.exit(1) : reject(new DBAccessQueryResult(client, undefined, error)); } return resolve(new DBAccessQueryResult(client, data, undefined)); }); }); - } + }; /** * Sends given SQL query to PostgreSQL. */ - private static async _queryPG( + private static _queryPG = async ( conversion: Conversion, caller: string, sql: string, @@ -216,15 +243,19 @@ export default class DBAccess { shouldReturnClient: boolean, client?: PoolClient, bindings?: any[] - ): Promise { + ): Promise => { try { - const data: any = Array.isArray(bindings) ? await (client).query(sql, bindings) : await (client).query(sql); + const data: any = Array.isArray(bindings) + ? await (client).query(sql, bindings) + : await (client).query(sql); + return new DBAccessQueryResult(client, data, undefined); } catch (error) { - await generateError(conversion, `\t--[${ caller }] ${ error }`, sql); + generateError(conversion, `\t--[${ caller }] ${ error }`, sql); return processExitOnError ? process.exit(1) : new DBAccessQueryResult(client, undefined, error); } finally { - await DBAccess._releaseDbClientIfNecessary(conversion, (client), shouldReturnClient); // Sets the client undefined. + // Sets the client undefined. + DBAccess._releaseDbClientIfNecessary(conversion, (client), shouldReturnClient); } - } + }; } diff --git a/src/DataChunksProcessor.ts b/src/DataChunksProcessor.ts index bf5a3edd..e8c1a4fe 100644 --- a/src/DataChunksProcessor.ts +++ b/src/DataChunksProcessor.ts @@ -38,7 +38,12 @@ export default async (conversion: Conversion, tableName: string, haveDataChunksP const originalTableName: string = extraConfigProcessor.getTableName(conversion, tableName, true); const logTitle: string = 'DataChunksProcessor::default'; - const selectFieldList: string = arrangeColumnsData(conversion._dicTables[tableName].arrTableColumns, conversion._mysqlVersion, conversion._encoding); + const selectFieldList: string = arrangeColumnsData( + conversion._dicTables[tableName].arrTableColumns, + +(conversion._mysqlVersion.split(".").slice(0, 2).join(".")), + conversion._encoding, + ); + const sqlRowsCnt: string = `SELECT COUNT(1) AS rows_count FROM \`${ originalTableName }\`;`; const params: IDBAccessQueryParams = { conversion: conversion, diff --git a/src/DataLoader.ts b/src/DataLoader.ts index 3df80c6b..4543fea0 100644 --- a/src/DataLoader.ts +++ b/src/DataLoader.ts @@ -38,6 +38,9 @@ import { PoolConnection } from 'mysql2'; const { from } = require('pg-copy-streams'); // No declaration file for module "pg-copy-streams". const { Transform: Json2CsvTransform } = require('json2csv'); // No declaration file for module "json2csv". +/** + * Processes incoming messages from the DataPipeManager. + */ process.on('message', async (signal: MessageToDataLoader) => { const { config, chunk } = signal; const conv: Conversion = new Conversion(config); @@ -81,9 +84,9 @@ const deleteChunk = async ( await enableTriggers(conversion, client, originalSessionReplicationRole); } } catch (error) { - await generateError(conversion, `\t--[DataLoader::deleteChunk] ${ error }`, sql); + generateError(conversion, `\t--[DataLoader::deleteChunk] ${ error }`, sql); } finally { - await DBAccess.releaseDbClient(conversion, client); + DBAccess.releaseDbClient(conversion, client); } }; @@ -100,7 +103,7 @@ const processDataError = async ( client: PoolClient, originalSessionReplicationRole: string | null ): Promise => { - await generateError(conv, `\t--[populateTableWorker] ${ streamError }`, sqlCopy); + generateError(conv, `\t--[populateTableWorker] ${ streamError }`, sqlCopy); const rejectedData: string = `\t--[populateTableWorker] Error loading table data:\n${ sql }\n`; log(conv, rejectedData, path.join(conv._logsDirPath, `${ tableName }.log`)); await deleteChunk(conv, dataPoolId, client, originalSessionReplicationRole); @@ -238,7 +241,7 @@ const disableTriggers = async (conversion: Conversion, client: PoolClient): Prom sql = 'SET session_replication_role = replica;'; await client.query(sql); } catch (error) { - await generateError(conversion, `\t--[DataLoader::disableTriggers] ${ error }`, sql); + generateError(conversion, `\t--[DataLoader::disableTriggers] ${ error }`, sql); } return originalSessionReplicationRole; @@ -258,6 +261,6 @@ const enableTriggers = async ( try { await client.query(sql); } catch (error) { - await generateError(conversion, `\t--[DataLoader::enableTriggers] ${ error }`, sql); + generateError(conversion, `\t--[DataLoader::enableTriggers] ${ error }`, sql); } }; diff --git a/src/DataPipeManager.ts b/src/DataPipeManager.ts index c3858352..152b5ab2 100644 --- a/src/DataPipeManager.ts +++ b/src/DataPipeManager.ts @@ -23,7 +23,8 @@ import * as path from 'path'; import { ChildProcess, fork } from 'child_process'; import { EventEmitter } from 'events'; -import { log, generateError } from './FsOps'; +import { killProcess } from './Utils'; +import { log } from './FsOps'; import { processConstraintsPerTable } from './ConstraintsProcessor'; import * as migrationStateManager from './MigrationStateManager'; import Conversion from './Conversion'; @@ -64,17 +65,6 @@ const getDataLoaderOptions = (conversion: Conversion): any => { return options; }; -/** - * Kills a process specified by the pid. - */ -const killProcess = async (pid: number, conversion: Conversion): Promise => { - try { - process.kill(pid); - } catch (killError) { - await generateError(conversion, `\t--[killProcess] ${ killError }`); - } -}; - /** * Checks if all data chunks were processed. */ @@ -90,6 +80,7 @@ const dataPoolProcessed = (conversion: Conversion): boolean => { const getNumberOfSimultaneouslyRunningLoaderProcesses = (conversion: Conversion): number => { if (conversion._numberOfSimultaneouslyRunningLoaderProcesses !== 'DEFAULT') { return Math.min( + (os.cpus().length || 1), conversion._dataPool.length, conversion._maxEachDbConnectionPoolSize, conversion._numberOfSimultaneouslyRunningLoaderProcesses, @@ -118,7 +109,7 @@ const runLoaderProcess = (conversion: Conversion): void => { const loaderProcess: ChildProcess = fork(dataLoaderPath, getDataLoaderOptions(conversion)); loaderProcessesCount++; - loaderProcess.on('message', async (signal: MessageToMaster) => { + loaderProcess.on('message', (signal: MessageToMaster) => { // Following actions are performed when a message from the loader process is accepted: // 1. Log an info regarding the just-populated table. // 2. Kill the loader process to release unused RAM as quick as possible. @@ -129,7 +120,7 @@ const runLoaderProcess = (conversion: Conversion): void => { + ` "${ conversion._schema }"."${ signal.tableName }": ${ signal.totalRowsToInsert }`; log(conversion, msg); - await killProcess(loaderProcess.pid, conversion); + killProcess(loaderProcess.pid, conversion); loaderProcessesCount--; eventEmitter.emit(tableLoadingFinishedEvent, signal.tableName); runLoaderProcess(conversion); diff --git a/src/FsOps.ts b/src/FsOps.ts index b81b7fc9..da48ebff 100644 --- a/src/FsOps.ts +++ b/src/FsOps.ts @@ -20,68 +20,49 @@ */ import * as fs from 'fs'; import * as path from 'path'; -import ErrnoException = NodeJS.ErrnoException; +import { ChildProcess } from 'child_process'; import Conversion from './Conversion'; +import { LogMessage } from './LogMessage'; +import { LogMessageType } from './LogMessageType'; +import ErrnoException = NodeJS.ErrnoException; /** - * Writes a detailed error message to the "/errors-only.log" file. + * Sends error-log to dedicated logger process. */ -export const generateError = (conversion: Conversion, message: string, sql: string = ''): Promise => { - return new Promise(resolve => { - message += `\n\n\tSQL: ${sql}\n\n`; - const buffer: Buffer = Buffer.from(message, conversion._encoding); - log(conversion, message, undefined); - - fs.open(conversion._errorLogsPath, 'a', conversion._0777, (error: ErrnoException | null, fd: number) => { - if (error) { - return resolve(); - } - - fs.write(fd, buffer, 0, buffer.length, null, () => { - fs.close(fd, () => resolve()); - }); - }); - }); +export const generateError = ( + conversion: Conversion, + message: string, + sql: string = '', +): void => { + (conversion.logger).send( + new LogMessage( + LogMessageType.ERROR, + message, + sql, + ) + ); }; /** - * Outputs given log. - * Writes given log to the "/all.log" file. - * If necessary, writes given log to the "/{tableName}.log" file. + * Sends log to dedicated logger process. */ -export const log = (conversion: Conversion, log: string | NodeJS.ErrnoException, tableLogPath?: string, callback?: Function): void => { - console.log(log); - const buffer: Buffer = Buffer.from(`${ log }\n\n`, conversion._encoding); +export const log = ( + conversion: Conversion, + log: string | ErrnoException, + tableLogPath?: string, + isConcluding: boolean = false, +): void => { + const messageType: LogMessageType = isConcluding ? LogMessageType.EXIT : LogMessageType.LOG; - fs.open(conversion._allLogsPath, 'a', conversion._0777, (error: ErrnoException | null, fd: number) => { - if (!error) { - fs.write(fd, buffer, 0, buffer.length, null, () => { - fs.close(fd, () => { - if (tableLogPath) { - fs.open(tableLogPath, 'a', conversion._0777, (error: ErrnoException | null, fd: number) => { - if (!error) { - fs.write(fd, buffer, 0, buffer.length, null, () => { - fs.close(fd, () => { - // Each async function MUST have a callback (according to Node.js >= 7). - if (callback) { - callback(); - } - }); - }); - } else if (callback) { - callback(error); - } - }); - } else if (callback) { - callback(); - } - }); - }); - } else if (callback) { - callback(error); - } - }); + (conversion.logger).send( + new LogMessage( + messageType, + log, + undefined, + tableLogPath, + ) + ); }; /** diff --git a/src/LogMessage.ts b/src/LogMessage.ts new file mode 100644 index 00000000..b61ebc14 --- /dev/null +++ b/src/LogMessage.ts @@ -0,0 +1,34 @@ +/* + * This file is a part of "NMIG" - the database migration tool. + * + * Copyright (C) 2016 - present, Anatoly Khaytovich + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program (please see the "LICENSE.md" file). + * If not, see . + * + * @author Anatoly Khaytovich + */ +import { LogMessageType } from './LogMessageType'; + +export class LogMessage { + /** + * LogMessage constructor. + */ + public constructor( + public readonly type: LogMessageType, + public readonly message?: string | NodeJS.ErrnoException, + public readonly sql?: string, + public readonly tableLogPath?: string, + public readonly config?: any, + ) {} +} diff --git a/src/LogMessageType.ts b/src/LogMessageType.ts new file mode 100644 index 00000000..d45dee2a --- /dev/null +++ b/src/LogMessageType.ts @@ -0,0 +1,26 @@ +/* + * This file is a part of "NMIG" - the database migration tool. + * + * Copyright (C) 2016 - present, Anatoly Khaytovich + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program (please see the "LICENSE.md" file). + * If not, see . + * + * @author Anatoly Khaytovich + */ +export enum LogMessageType { + LOG, + ERROR, + CONFIG, + EXIT, +} diff --git a/src/LogsProcessor.ts b/src/LogsProcessor.ts new file mode 100644 index 00000000..5821e80f --- /dev/null +++ b/src/LogsProcessor.ts @@ -0,0 +1,139 @@ +/* + * This file is a part of "NMIG" - the database migration tool. + * + * Copyright (C) 2016 - present, Anatoly Khaytovich + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program (please see the "LICENSE.md" file). + * If not, see . + * + * @author Anatoly Khaytovich + */ +import * as fs from 'fs'; +import ErrnoException = NodeJS.ErrnoException; + +import Conversion from './Conversion'; +import { LogMessage } from './LogMessage'; +import { LogMessageType } from './LogMessageType'; + +/** + * Writes a detailed error message to the "/errors-only.log" file. + */ +const _generateErrorInBackground = ( + conversion: Conversion, + message: string, + sql: string = '', +): Promise => { + return new Promise(async resolve => { + message += sql !== '' ? `\n\n\tSQL: ${sql}\n\n` : sql; + const buffer: Buffer = Buffer.from(message, conversion._encoding); + await _logInBackground(conversion, message); + + fs.open(conversion._errorLogsPath, 'a', conversion._0777, (error: ErrnoException | null, fd: number) => { + if (error) { + console.error(error); + return resolve(); + } + + fs.write(fd, buffer, 0, buffer.length, null, (fsWriteError: ErrnoException | null) => { + if (fsWriteError) { + console.error(fsWriteError); + // !!!Note, still must close current "fd", since recent "fs.open" has definitely succeeded. + } + + fs.close(fd, () => resolve()); + }); + }); + }); +}; + +/** + * Outputs given log. + * Writes given log to the "/all.log" file. + * If necessary, writes given log to the "/{tableName}.log" file. + */ +const _logInBackground = ( + conversion: Conversion, + log: string | ErrnoException, + tableLogPath?: string, +): Promise => { + return new Promise(resolve => { + console.log(log); + const buffer: Buffer = Buffer.from(`${ log }\n\n`, conversion._encoding); + + fs.open(conversion._allLogsPath, 'a', conversion._0777, (err: ErrnoException | null, fd: number) => { + if (err) { + console.error(err); + return resolve(); + } + + fs.write(fd, buffer, 0, buffer.length, null, (fsWriteError: ErrnoException | null) => { + if (fsWriteError) { + console.error(fsWriteError); + // !!!Note, still must close current "fd", since recent "fs.open" has definitely succeeded. + } + + fs.close(fd, () => { + if (tableLogPath) { + fs.open(tableLogPath, 'a', conversion._0777, (error: ErrnoException | null, fd: number) => { + if (error) { + console.error(error); + return resolve(); + } else { + fs.write(fd, buffer, 0, buffer.length, null, (fsWriteError: ErrnoException | null) => { + if (fsWriteError) { + console.error(fsWriteError); + // !!!Note, still must close current "fd", since recent "fs.open" has definitely succeeded. + } + + fs.close(fd, () => resolve()); + }); + } + }); + } else { + return resolve(); + } + }); + }); + }); + }); +}; + +/** + * Conversion instance, used in a context of logger process. + */ +let conv: Conversion; + +/** + * Process incoming logs in a context of logger process. + */ +process.on('message', async (_log: LogMessage) => { + try { + if (_log.type === LogMessageType.CONFIG) { + // Create Conversion instance, but avoid recursion, + // which might lead to redundant logger processes creation. + const avoidLogger: boolean = true; + conv = conv || new Conversion(_log.config, avoidLogger); + } else if (_log.type === LogMessageType.LOG) { + await _logInBackground(conv, _log.message, _log.tableLogPath); + } else if (_log.type === LogMessageType.ERROR) { + await _generateErrorInBackground(conv, _log.message, _log.sql); + } else if (_log.type === LogMessageType.EXIT) { + // Migration has been just finished. + // All resources must be released. + await _logInBackground(conv, _log.message, _log.tableLogPath); + process.exit(0); + } + } catch (error) { + console.log(`\n\t--[LogsProcessor] Logger error: ${JSON.stringify(error)}\n`); + } +}); diff --git a/src/ReportGenerator.ts b/src/ReportGenerator.ts index 507e408d..d2d9c24b 100644 --- a/src/ReportGenerator.ts +++ b/src/ReportGenerator.ts @@ -26,7 +26,7 @@ import Conversion from './Conversion'; /** * Generates a summary report. */ -export default (conversion: Conversion): void => { +export default async (conversion: Conversion): Promise => { if (conversion._runsInTestMode) { (conversion._eventEmitter).emit(conversion._migrationCompletedEvent); return; @@ -45,5 +45,6 @@ export default (conversion: Conversion): void => { \n\t--[generateReport] Total time: ${ formattedHours }:${ formattedMinutes }:${ formattedSeconds } \n\t--[generateReport] (hours:minutes:seconds)`; - log(conversion, output, undefined, () => process.exit(0)); + log(conversion, output, undefined, true); + process.exit(0); }; diff --git a/src/SequencesProcessor.ts b/src/SequencesProcessor.ts index 1d542a23..e2bfc68e 100644 --- a/src/SequencesProcessor.ts +++ b/src/SequencesProcessor.ts @@ -102,7 +102,7 @@ export const createIdentity = async (conversion: Conversion, tableName: string): const createSequenceResult: DBAccessQueryResult = await DBAccess.query(params); if (createSequenceResult.error) { - await DBAccess.releaseDbClient(conversion, createSequenceResult.client); + DBAccess.releaseDbClient(conversion, createSequenceResult.client); return; } diff --git a/src/StructureLoader.ts b/src/StructureLoader.ts index 95ff7064..43cec5dc 100644 --- a/src/StructureLoader.ts +++ b/src/StructureLoader.ts @@ -41,10 +41,10 @@ const processTableBeforeDataLoading = async (conversion: Conversion, tableName: /** * Retrieves the source db (MySQL) version. */ -const getMySqlVersion = async (conversion: Conversion): Promise => { +const setMySqlVersion = async (conversion: Conversion): Promise => { const params: IDBAccessQueryParams = { conversion: conversion, - caller: 'StructureLoader::getMySqlVersion', + caller: 'StructureLoader::setMySqlVersion', sql: 'SELECT VERSION() AS mysql_version;', vendor: DBVendors.MYSQL, processExitOnError: false, @@ -60,7 +60,7 @@ const getMySqlVersion = async (conversion: Conversion): Promise => { const arrVersion: string[] = result.data[0].mysql_version.split('.'); const majorVersion: string = arrVersion[0]; const minorVersion: string = arrVersion.slice(1).join(''); - conversion._mysqlVersion = +(`${ majorVersion }.${ minorVersion }`); + conversion._mysqlVersion = `${ majorVersion }.${ minorVersion }`; }; /** @@ -68,7 +68,7 @@ const getMySqlVersion = async (conversion: Conversion): Promise => { */ export default async (conversion: Conversion): Promise => { const logTitle: string = 'StructureLoader::default'; - await getMySqlVersion(conversion); + await setMySqlVersion(conversion); const haveTablesLoaded: boolean = await migrationStateManager.get(conversion, 'tables_loaded'); let sql: string = `SHOW FULL TABLES IN \`${ conversion._mySqlDbName }\` WHERE 1 = 1`; diff --git a/src/Utils.ts b/src/Utils.ts index 7279a085..4b5316d7 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -20,21 +20,33 @@ */ import { v4 as uuidV4 } from 'uuid'; +import Conversion from './Conversion'; +import { generateError } from './FsOps'; + /** * PostgreSQL has a limit of 63 characters for identifier names. * This function substitutes a postfix of possibly long identifiers with UUID string to ensure identifier uniqueness. */ export const getUniqueIdentifier = (identifier: string, mandatoryPostfix: string = ''): string => { - const MAX_IDENTIFIER_LENGTH: number = 63; - - if (identifier.length > MAX_IDENTIFIER_LENGTH) { - const uuidSliceStart: number = mandatoryPostfix.length === 0 - ? mandatoryPostfix.length - : mandatoryPostfix.length - 1; + const MAX_PG_IDENTIFIER_LENGTH: number = 63; + if (identifier.length > MAX_PG_IDENTIFIER_LENGTH) { + const mandatoryPostfixLength: number = mandatoryPostfix.length; + const uuidSliceStart: number = mandatoryPostfixLength === 0 ? mandatoryPostfixLength : mandatoryPostfixLength - 1; const uuid: string = uuidV4().slice(uuidSliceStart) + mandatoryPostfix; - return identifier.slice(0, (MAX_IDENTIFIER_LENGTH - uuid.length)) + uuid; + return identifier.slice(0, (MAX_PG_IDENTIFIER_LENGTH - uuid.length)) + uuid; } return identifier; }; + +/** + * Kills a process specified by the pid. + */ +export const killProcess = (pid: number, conversion: Conversion): void => { + try { + process.kill(pid); + } catch (killError) { + generateError(conversion, `\t--[killProcess] ${ killError }`); + } +}; diff --git a/tsconfig.json b/tsconfig.json index aabbb3fd..b4a97514 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,22 @@ { "compilerOptions": { + "noImplicitAny": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "strictPropertyInitialization": true, + "noImplicitThis": true, + "alwaysStrict": true, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, "removeComments": true, - "module": "commonjs", "allowJs": true, - "target": "es2017", "sourceMap": true, + "module": "commonjs", + "moduleResolution": "node", + "target": "es2017", "outDir": "./dist", - "strict": true, "types": [ "node", "pg",