@sprucelabs/postgres-data-store 3.0.0 → 3.0.2
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.
|
@@ -183,11 +183,11 @@ class PostgresDatabase {
|
|
|
183
183
|
}
|
|
184
184
|
async connect() {
|
|
185
185
|
var _a;
|
|
186
|
-
|
|
186
|
+
this.client = new pg_1.Client({
|
|
187
187
|
connectionString: this.connectionString,
|
|
188
188
|
});
|
|
189
189
|
try {
|
|
190
|
-
await client.connect();
|
|
190
|
+
await this.client.connect();
|
|
191
191
|
}
|
|
192
192
|
catch (err) {
|
|
193
193
|
const message = err.message;
|
|
@@ -210,7 +210,6 @@ class PostgresDatabase {
|
|
|
210
210
|
originalError: err,
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
|
-
this.client = client;
|
|
214
213
|
}
|
|
215
214
|
async getUniqueIndexes(collectionName) {
|
|
216
215
|
const isUnique = true;
|
|
@@ -324,7 +323,7 @@ class PostgresDatabase {
|
|
|
324
323
|
}
|
|
325
324
|
isConnected() {
|
|
326
325
|
//@ts-ignore
|
|
327
|
-
return this.client._connected && !this.client._ending;
|
|
326
|
+
return this.client ? this.client._connected && !this.client._ending : false;
|
|
328
327
|
}
|
|
329
328
|
parseIndexViolatedForFieldsAndValues(input) {
|
|
330
329
|
const regex = /Key \((.*)\)=\((.*)\) already exists\./;
|
|
@@ -226,11 +226,11 @@ export default class PostgresDatabase {
|
|
|
226
226
|
connect() {
|
|
227
227
|
var _a;
|
|
228
228
|
return __awaiter(this, void 0, void 0, function* () {
|
|
229
|
-
|
|
229
|
+
this.client = new Client({
|
|
230
230
|
connectionString: this.connectionString,
|
|
231
231
|
});
|
|
232
232
|
try {
|
|
233
|
-
yield client.connect();
|
|
233
|
+
yield this.client.connect();
|
|
234
234
|
}
|
|
235
235
|
catch (err) {
|
|
236
236
|
const message = err.message;
|
|
@@ -253,7 +253,6 @@ export default class PostgresDatabase {
|
|
|
253
253
|
originalError: err,
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
|
-
this.client = client;
|
|
257
256
|
});
|
|
258
257
|
}
|
|
259
258
|
getUniqueIndexes(collectionName) {
|
|
@@ -386,7 +385,7 @@ export default class PostgresDatabase {
|
|
|
386
385
|
}
|
|
387
386
|
isConnected() {
|
|
388
387
|
//@ts-ignore
|
|
389
|
-
return this.client._connected && !this.client._ending;
|
|
388
|
+
return this.client ? this.client._connected && !this.client._ending : false;
|
|
390
389
|
}
|
|
391
390
|
parseIndexViolatedForFieldsAndValues(input) {
|
|
392
391
|
const regex = /Key \((.*)\)=\((.*)\) already exists\./;
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"sprucebot",
|
|
23
23
|
"sprucelabs"
|
|
24
24
|
],
|
|
25
|
-
"version": "3.0.
|
|
25
|
+
"version": "3.0.2",
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build.ci": "yarn build.tsc && yarn build.resolve-paths && yarn lint",
|
|
28
28
|
"build.dev": "yarn build.tsc --sourceMap ; yarn resolve-paths.lint",
|
|
@@ -51,18 +51,18 @@
|
|
|
51
51
|
"watch.tsc": "tsc -w"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@sprucelabs/data-stores": "^23.0.
|
|
55
|
-
"@sprucelabs/schema": "^28.5.
|
|
54
|
+
"@sprucelabs/data-stores": "^23.0.1",
|
|
55
|
+
"@sprucelabs/schema": "^28.5.159",
|
|
56
56
|
"pg": "^8.10.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@sprucelabs/esm-postbuild": "^4.0.
|
|
60
|
-
"@sprucelabs/jest-json-reporter": "^7.0.
|
|
61
|
-
"@sprucelabs/resolve-path-aliases": "^1.1.
|
|
59
|
+
"@sprucelabs/esm-postbuild": "^4.0.1",
|
|
60
|
+
"@sprucelabs/jest-json-reporter": "^7.0.17",
|
|
61
|
+
"@sprucelabs/resolve-path-aliases": "^1.1.204",
|
|
62
62
|
"@sprucelabs/semantic-release": "^4.0.8",
|
|
63
63
|
"@sprucelabs/spruce-test-fixtures": "^52.8.0",
|
|
64
|
-
"@sprucelabs/test": "^7.7.
|
|
65
|
-
"@sprucelabs/test-utils": "^3.4.
|
|
64
|
+
"@sprucelabs/test": "^7.7.434",
|
|
65
|
+
"@sprucelabs/test-utils": "^3.4.30",
|
|
66
66
|
"@types/node": "^18.14.0",
|
|
67
67
|
"@types/pg": "^8.6.6",
|
|
68
68
|
"chokidar-cli": "^3.0.0",
|