Skip to content

Commit ab450c0

Browse files
committed
upgraded node-postgres to 7.4.x
1 parent da69654 commit ab450c0

File tree

7 files changed

+51
-57
lines changed

7 files changed

+51
-57
lines changed

.vscode/launch.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,15 @@
77
"request": "launch",
88
"program": "${workspaceRoot}/bin/tests/run.js",
99
"stopOnEntry": false,
10-
"args": [],
11-
"cwd": "${workspaceRoot}",
12-
"preLaunchTask": "build",
13-
"runtimeExecutable": null,
10+
"cwd": "${workspaceRoot}/bin",
1411
"runtimeArgs": ["--nolazy"],
1512
"env": {
1613
"NODE_ENV": "development"
1714
},
1815
"console": "externalTerminal",
1916
"sourceMaps": true,
20-
"outDir": "${workspaceRoot}/bin"
17+
"outFiles": ["${workspaceRoot}/bin/**/*.js"],
18+
"preLaunchTask": "build"
2119
}
2220
]
2321
}

.vscode/tasks.json

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,38 @@
11
{
2-
"version": "0.1.0",
3-
"command": "gulp",
4-
"isShellCommand": true,
5-
"args": [
6-
"--no-color"
7-
],
2+
"version": "2.0.0",
83
"tasks": [
94
{
10-
"taskName": "clean",
11-
"args": [],
12-
"isBuildCommand": false,
13-
"isTestCommand": false,
14-
"isWatching": false,
15-
"showOutput": "silent"
5+
"type": "gulp",
6+
"task": "clean",
7+
"presentation": {
8+
"reveal": "silent"
9+
},
1610
},
1711
{
18-
"taskName": "build",
19-
"args": [],
20-
"isBuildCommand": true,
21-
"isTestCommand": false,
22-
"isWatching": false,
23-
"problemMatcher": ["$tsc"],
24-
"showOutput": "silent"
12+
"type": "gulp",
13+
"task": "build",
14+
"group": {
15+
"kind": "build",
16+
"isDefault": true
17+
},
18+
"presentation": {
19+
"reveal": "silent"
20+
},
21+
"problemMatcher": ["$tsc"]
2522
},
2623
{
27-
"taskName": "test",
28-
"args": [],
29-
"isBuildCommand": false,
30-
"isTestCommand": true,
31-
"isWatching": false,
32-
"problemMatcher": ["$tsc"],
33-
"showOutput": "always"
24+
"type": "gulp",
25+
"task": "test",
26+
"group": {
27+
"kind": "test",
28+
"isDefault": true
29+
},
30+
"problemMatcher": ["$tsc"]
3431
},
3532
{
36-
"taskName": "publish",
37-
"args": [],
38-
"isBuildCommand": false,
39-
"isTestCommand": false,
40-
"isWatching": false,
41-
"problemMatcher": ["$tsc"],
42-
"showOutput": "always"
33+
"type": "gulp",
34+
"task": "publish",
35+
"problemMatcher": ["$tsc"]
4336
}
4437
]
4538
}

bin/lib/Database.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pg-io",
3-
"version": "0.8.3",
3+
"version": "0.8.4",
44
"description": "Promise-based PostgreSQL client for node.js written in TypeScript",
55
"keywords": [
66
"pg",
@@ -21,10 +21,10 @@
2121
"email": "irakliy81@live.com"
2222
},
2323
"engines": {
24-
"node": "6.9.x"
24+
"node": "6.11.x"
2525
},
2626
"dependencies": {
27-
"pg": "6.1.x"
27+
"pg": "7.4.x"
2828
},
2929
"devDependencies": {
3030
"del": "2.2.x",

lib/Database.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ export class Database extends events.EventEmitter {
6868
this.pgPool = new pg.Pool(buildPgPoolOptions(connectionSettings, poolOptions));
6969

7070
this.pgPool.on('error', (error) => {
71-
this.logger && this.logger.warn('pg.pool error: ' + error.message);
72-
// turn off error emitter because pgPool emits duplicate errors when client creation fails
73-
// this.emit(ERROR_EVENT, error);
71+
//this.logger && this.logger.warn('pg.pool error: ' + error.message);
72+
//turn off error emitter because pgPool emits duplicate errors when client creation fails
73+
this.emit(ERROR_EVENT, error);
7474
});
7575
}
7676

@@ -99,13 +99,13 @@ export class Database extends events.EventEmitter {
9999
// --------------------------------------------------------------------------------------------
100100
getPoolState(): PoolState {
101101
return {
102-
size : this.pgPool.pool.getPoolSize(),
103-
available : this.pgPool.pool.availableObjectsCount()
102+
size : this.pgPool.totalCount,
103+
available : this.pgPool.idleCount
104104
};
105105
}
106106

107107
getPoolDescription(): string {
108-
return `{ size: ${this.pgPool.pool.getPoolSize()}, available: ${this.pgPool.pool.availableObjectsCount()} }`;
108+
return `{ size: ${this.pgPool.totalCount}, available: ${this.pgPool.idleCount} }`;
109109
}
110110
}
111111

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pg-io",
3-
"version": "0.8.3",
3+
"version": "0.8.4",
44
"description": "Promise-based PostgreSQL client for node.js written in TypeScript",
55
"keywords": [
66
"pg",
@@ -21,10 +21,10 @@
2121
"email": "irakliy81@live.com"
2222
},
2323
"engines": {
24-
"node": "6.9.x"
24+
"node": "6.11.x"
2525
},
2626
"dependencies": {
27-
"pg": "6.1.x"
27+
"pg": "7.4.x"
2828
},
2929
"devDependencies": {
3030
"del": "2.2.x",

typings/pg/pg.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,13 @@ declare module "pg" {
5555
}
5656

5757
export class Pool extends events.EventEmitter {
58-
pool: any;
5958
constructor(config: ClientConfig);
6059
connect(callback?: (err: Error, client: Client, done: (err: Error) => void) => void): Promise<Client>;
6160
end(): Promise<any>;
61+
62+
waitingCount: number;
63+
idleCount : number;
64+
totalCount : number;
6265
}
6366

6467
export class Client extends events.EventEmitter {

0 commit comments

Comments
 (0)