()
| 24 | const app = express(); |
| 25 | |
| 26 | const createConn = async () => { |
| 27 | console.log('Creating PG connection.'); |
| 28 | |
| 29 | const credsResponse = await herokuClient.get(`addons/${herokuPostgresId}/config`); |
| 30 | const pgConnStr = credsResponse.data[0]['value']; |
| 31 | |
| 32 | pgConfig = { |
| 33 | ...parsePgConnStr(pgConnStr), ...{ |
| 34 | max: 1, |
| 35 | ssl: true, |
| 36 | }, |
| 37 | }; |
| 38 | |
| 39 | pgPool = new pg.Pool(pgConfig); |
| 40 | }; |
| 41 | |
| 42 | const performQuery = async () => { |
| 43 | const client = await pgPool.connect(); |