result in Client.query() callback has the same type with result object in Query end event. (#9307)

This commit is contained in:
Leo Liang
2016-05-15 02:20:51 +09:00
committed by Masahiro Wakame
parent adfe4a9c78
commit 53ed90b6e7
2 changed files with 4 additions and 3 deletions
+1
View File
@@ -35,6 +35,7 @@ client.connect((err) => {
if (err) {
return console.error("Error running query", err);
}
console.log(result.rowCount);
console.log(result.rows[0]["theTime"]);
client.end();
return null;
Vendored
+3 -3
View File
@@ -40,13 +40,13 @@ declare module "pg" {
}
export interface QueryResult {
command: string;
rowCount: number;
oid: number;
rows: any[];
}
export interface ResultBuilder extends QueryResult {
command: string;
rowCount: number;
oid: number;
addRow(row: any): void;
}