@voxpelli/pg-utils 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/test-helpers.d.ts.map +1 -1
- package/lib/test-helpers.js +4 -3
- package/package.json +14 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-helpers.d.ts","sourceRoot":"","sources":["test-helpers.js"],"names":[],"mappings":"AAqBA;IAeE,qBADY,oBAAoB,EAsC/B;IAxCD,cADW,IAAI,CAAC,OAAO,CAAC,CACX;
|
|
1
|
+
{"version":3,"file":"test-helpers.d.ts","sourceRoot":"","sources":["test-helpers.js"],"names":[],"mappings":"AAqBA;IAeE,qBADY,oBAAoB,EAsC/B;IAxCD,cADW,IAAI,CAAC,OAAO,CAAC,CACX;IA0Eb,cADc,OAAO,CAAC,IAAI,CAAC,CAiB1B;IAGD,kBADc,OAAO,CAAC,IAAI,CAAC,CAM1B;IAGD,gBADc,OAAO,CAAC,IAAI,CAAC,CAc1B;IAGD,OADc,OAAO,CAAC,IAAI,CAAC,CAG1B;;CACF;;sBA3Ia,MAAM;oBACN,MAAM,GAAG,GAAG;mBACZ,MAAM,EAAE;YACR,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,OAAO,EAAE,KAAK,CAAC,OAAO,WAAW,EAAE,gBAAgB,CAAC,IAAI,EAAE,OAAO,WAAW,EAAE,sBAAsB,CAAC,CAAC,CAAC;6BAC9I,KAAK,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC;;0BARZ,IAAI"}
|
package/lib/test-helpers.js
CHANGED
|
@@ -81,10 +81,11 @@ export class PgTestHelpers {
|
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
83
|
* @param {Array<string[] | string>} tables
|
|
84
|
+
* @param {boolean} [allowParallelRemoval]
|
|
84
85
|
* @returns {Promise<void>}
|
|
85
86
|
*/
|
|
86
|
-
async #removeTablesByName (tables) {
|
|
87
|
-
if (isStringArray(tables)) {
|
|
87
|
+
async #removeTablesByName (tables, allowParallelRemoval = false) {
|
|
88
|
+
if (allowParallelRemoval && isStringArray(tables)) {
|
|
88
89
|
await Promise.all(
|
|
89
90
|
tables.map(name => this.queryPromise('DROP TABLE IF EXISTS ' + name + ' CASCADE'))
|
|
90
91
|
).catch(cause => {
|
|
@@ -94,7 +95,7 @@ export class PgTestHelpers {
|
|
|
94
95
|
for (const name of tables) {
|
|
95
96
|
await (
|
|
96
97
|
Array.isArray(name)
|
|
97
|
-
? this.#removeTablesByName(name)
|
|
98
|
+
? this.#removeTablesByName(name, true)
|
|
98
99
|
: this.queryPromise('DROP TABLE IF EXISTS ' + name + ' CASCADE').catch(cause => {
|
|
99
100
|
throw new Error(`Failed to drop table: ${name}`, { cause });
|
|
100
101
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voxpelli/pg-utils",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": " My personal database utils / helpers for Postgres",
|
|
5
5
|
"homepage": "http://github.com/voxpelli/pg-utils",
|
|
6
6
|
"repository": {
|
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
"clean:declarations-top": "rm -rf $(find . -maxdepth 1 -type f -name '*.d.ts*' ! -name 'index.d.ts')",
|
|
38
38
|
"clean:declarations-lib": "rm -rf $(find lib -type f -name '*.d.ts*' ! -name '*-types.d.ts')",
|
|
39
39
|
"clean": "run-p clean:*",
|
|
40
|
-
"
|
|
40
|
+
"husky-enable": "husky",
|
|
41
|
+
"husky-disable": "git config --unset core.hooksPath",
|
|
41
42
|
"prepublishOnly": "run-s build",
|
|
42
43
|
"test:mocha": "c8 --reporter=lcov --reporter=text mocha 'test/**/*.spec.js'",
|
|
43
44
|
"test-ci": "run-s test:*",
|
|
@@ -47,28 +48,30 @@
|
|
|
47
48
|
"@types/chai": "^4.3.20",
|
|
48
49
|
"@types/chai-as-promised": "^7.1.8",
|
|
49
50
|
"@types/mocha": "^10.0.10",
|
|
50
|
-
"@types/node": "^20.
|
|
51
|
+
"@types/node": "^20.19.30",
|
|
51
52
|
"@types/pg-copy-streams": "^1.2.5",
|
|
53
|
+
"@types/sinon": "^21.0.0",
|
|
52
54
|
"@voxpelli/eslint-config": "^23.0.0",
|
|
53
|
-
"@voxpelli/tsconfig": "^
|
|
55
|
+
"@voxpelli/tsconfig": "^16.1.0",
|
|
54
56
|
"c8": "^10.1.3",
|
|
55
57
|
"chai": "^4.5.0",
|
|
56
58
|
"chai-as-promised": "^7.1.2",
|
|
57
|
-
"dotenv": "^
|
|
58
|
-
"eslint": "^9.
|
|
59
|
+
"dotenv": "^17.2.3",
|
|
60
|
+
"eslint": "^9.39.2",
|
|
59
61
|
"husky": "^9.1.7",
|
|
60
62
|
"installed-check": "^9.3.0",
|
|
61
|
-
"knip": "^5.
|
|
62
|
-
"mocha": "^11.
|
|
63
|
-
"npm-run-all2": "^
|
|
63
|
+
"knip": "^5.82.1",
|
|
64
|
+
"mocha": "^11.7.5",
|
|
65
|
+
"npm-run-all2": "^8.0.4",
|
|
66
|
+
"sinon": "^21.0.1",
|
|
64
67
|
"type-coverage": "^2.29.7",
|
|
65
|
-
"typescript": "~5.
|
|
68
|
+
"typescript": "~5.9.3",
|
|
66
69
|
"validate-conventional-commit": "^1.0.4"
|
|
67
70
|
},
|
|
68
71
|
"dependencies": {
|
|
69
72
|
"@types/pg": "^8.11.10",
|
|
70
73
|
"pg": "^8.13.1",
|
|
71
|
-
"pg-copy-streams": "^
|
|
74
|
+
"pg-copy-streams": "^7.0.0",
|
|
72
75
|
"umzeption": "^0.4.1",
|
|
73
76
|
"umzug": "^3.8.2"
|
|
74
77
|
}
|