new

Try Stack Overflow for Business

Our new business plan for private Q&A; offers single sign-on and advanced features. Get started by May 31 for 2 months free.

Learn more

All Questions

1
vote
1answer
64 views

When using async await, how do you specify a callback?

I was looking at how to use transactions in: https://node-postgres.com/features/transactions But in the following code example: const { Pool } = require('pg') const pool = new Pool() (async () =&...
1
vote
3answers
1k views

Async/Await Node-Postgres Queries Within ForEach Loops

EDIT: I'm using node v8.0.0 I just started learning how to access SQL databases with node-postgres, and I'm having a little bit of trouble accessing multiple databases to collect the data in a work ...
1
vote
2answers
503 views

Async pg-node query execution on object's array

I have an object's array which I need to iterate through, and insert each item into the DB (postgres). I'm using _.each in order to iterate through the array. arr = [ {name: 'Aaron', ...
4
votes
1answer
1k views

Node-Postgres query method not calling its callback function

I have the following code which uses node-postgres: var client = new pg.Client(conString); client.connect(function(err) { if(err) { throw new Error(console.error('could ...