Skip to content

Commit 64fcf60

Browse files
author
Pavel Romanov
committed
Mini fixes
1 parent 7baea7b commit 64fcf60

File tree

3 files changed

+4
-33
lines changed

3 files changed

+4
-33
lines changed

connections/PostgresConnection.js

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,13 @@ class PostgresConnection extends AbstractConnection {
88
super(config);
99
}
1010

11-
// async query(queryName, queryParams, queryOptions = null) {
12-
// const self = this;
13-
//
14-
// // let timeOld;
15-
// // if (queryOptions && queryOptions.time) {
16-
// // timeOld = Date.now();
17-
// // }
18-
//
19-
// const data = await self.client.query(self.queries[queryName], queryParams);
20-
// const {rows} = data;
21-
//
22-
// // if (queryOptions && queryOptions.time) {
23-
// // log.info(`Query ${queryName} execution time: ${Date.now() - timeOld} ms`);
24-
// // }
25-
//
26-
// return rows;
27-
// }
2811
async _executeQuery(query) {
2912
const {rows} = await this.client.query(query);
3013
return rows;
3114
}
3215

3316
async rawQuery(queryText, queryParams, queryOptions = null) {
34-
// let timeOld;
35-
// if (queryOptions && queryOptions.time && queryOptions.queryName) {
36-
// timeOld = Date.now();
37-
// }
38-
3917
const {rows} = await this.client.query(queryText, queryParams);
40-
41-
// if (queryOptions && queryOptions.time) {
42-
// log.info(`Query ${queryOptions.queryName} execution time: ${Date.now() - timeOld} ms`);
43-
// }
44-
4518
return rows;
4619
}
4720

@@ -56,9 +29,8 @@ class PostgresConnection extends AbstractConnection {
5629
}
5730

5831
const preparedQuery = escapeParams(queryText, queryParams);
59-
console.log(preparedQuery);
6032

61-
// return this._executeQuery(preparedQuery);
33+
return this._executeQuery(preparedQuery);
6234
}
6335

6436
getQueryText(queryName) {

connectors/AbstractConnector.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ class AbstractConnector {
1010
/**
1111
* @returns {Promise<AbstractConnection>} Connection
1212
*/
13-
async getConnection() {
13+
getConnection() {
1414
throw new TypeError('This method must be overridden!');
1515
}
1616

1717
/**
1818
* @param {AbstractConnection} connection Abstract connection
1919
*/
20-
async releaseConnection(connection) {
20+
releaseConnection(connection) {
2121
throw new TypeError('This method must be overridden!');
2222
}
2323

2424
/**
2525
* @async
2626
*/
27-
async closeConnection() {
27+
closeConnection() {
2828
throw new TypeError('This method must be overridden!');
2929
}
3030
}

connectors/PostgresConnector.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const {Pool} = require('pg');
2-
// const log = require('../../../../app/components/log')(module);
32

43
const AbstractConnector = require('./AbstractConnector');
54
const PostgresConnection = require('../connections/PostgresConnection');

0 commit comments

Comments
 (0)