aws-xray-sdk-postgres
Advanced tools
Comparing version 3.3.3 to 3.3.4
{ | ||
"env": { | ||
"node": true, | ||
"mocha": true, | ||
"es6": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"rules": { | ||
"indent": [ | ||
"error", | ||
2 | ||
], | ||
"linebreak-style": [ | ||
"error", | ||
"unix" | ||
], | ||
"quotes": [ | ||
"error", | ||
"single" | ||
], | ||
"semi": [ | ||
"error", | ||
"always" | ||
], | ||
"eol-last": [ | ||
"error", | ||
"always" | ||
] | ||
} | ||
"extends": "../../.eslintrc.json" | ||
} |
@@ -41,3 +41,3 @@ import * as AWSXRay from 'aws-xray-sdk-core'; | ||
queryText: string, | ||
values: any[], | ||
values: I, | ||
callback: (err: Error, result: PG.QueryResult<R>) => void, | ||
@@ -70,4 +70,4 @@ segment?: AWSXRay.SegmentLike | ||
interface PatchedPoolOnMethod { | ||
(event: "error", listener: (err: Error, client: PatchedPoolClient) => void): PatchedPool; | ||
(event: "connect" | "acquire" | "remove", listener: (client: PatchedPoolClient) => void): PatchedPool; | ||
(event: 'error', listener: (err: Error, client: PatchedPoolClient) => void): PatchedPool; | ||
(event: 'connect' | 'acquire' | 'remove', listener: (client: PatchedPoolClient) => void): PatchedPool; | ||
} | ||
@@ -88,3 +88,3 @@ | ||
interface PatchedEventsOnMethod { | ||
(event: "error", listener: (err: Error, client: PatchedClient) => void): PatchedEvents; | ||
(event: 'error', listener: (err: Error, client: PatchedClient) => void): PatchedEvents; | ||
} | ||
@@ -91,0 +91,0 @@ |
@@ -26,4 +26,5 @@ /** | ||
module.exports = function capturePostgres(pg) { | ||
if (pg.Client.prototype.__query) | ||
if (pg.Client.prototype.__query) { | ||
return pg; | ||
} | ||
@@ -30,0 +31,0 @@ pg.Client.prototype.__query = pg.Client.prototype.query; |
{ | ||
"name": "aws-xray-sdk-postgres", | ||
"version": "3.3.3", | ||
"version": "3.3.4", | ||
"description": "AWS X-Ray Patcher for Postgres (Javascript)", | ||
@@ -21,7 +21,9 @@ "author": "Amazon Web Services", | ||
"peerDependencies": { | ||
"aws-xray-sdk-core": "^3.3.3" | ||
"aws-xray-sdk-core": "^3.3.4" | ||
}, | ||
"scripts": { | ||
"test": "mocha --recursive ./test/ -R spec && tsd", | ||
"test-d": "tsd" | ||
"test-d": "tsd", | ||
"lint": "eslint .", | ||
"lint:fix": "eslint . --fix" | ||
}, | ||
@@ -39,3 +41,3 @@ "keywords": [ | ||
"repository": "https://github.com/aws/aws-xray-sdk-node/tree/master/packages/postgres", | ||
"gitHead": "ff228eeee2009711553cbcac5033d525206aba96" | ||
"gitHead": "c74bc4a3aa7aa349f2c3e970135664d689ba717b" | ||
} |
@@ -0,1 +1,2 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
import * as AWSXRay from 'aws-xray-sdk-core'; | ||
@@ -26,6 +27,6 @@ import * as PG from 'pg'; | ||
const queryCallback = (err: Error, result: PG.QueryResult) => void { | ||
} | ||
}; | ||
const queryArrayCallback = (err: Error, result: PG.QueryArrayResult) => void { | ||
} | ||
}; | ||
@@ -32,0 +33,0 @@ const queryStream = new PG.Query(); |
@@ -110,3 +110,5 @@ var assert = require('chai').assert; | ||
var stubClose = sandbox.stub(subsegment, 'close'); | ||
var session = { run: function(fcn) { fcn(); }}; | ||
var session = { run: function(fcn) { | ||
fcn(); | ||
}}; | ||
var stubRun = sandbox.stub(session, 'run'); | ||
@@ -196,6 +198,6 @@ | ||
postgres.__query = function(args, values) { | ||
postgres.__query = function() { | ||
this._queryable = true; | ||
this.queryQueue = [ null, null, queryObj ]; | ||
var result = new Promise(function(resolve, reject) { | ||
var result = new Promise(function(resolve) { | ||
resolve(); | ||
@@ -202,0 +204,0 @@ }); |
36330
532