Closed kelvich closed 1 year ago
I'll look into this today.
I can reproduce this not working ... but it also doesn't work for me with vanilla node-postgres (npm install pg). Normal behaviour seems to be that you can query prior to connect, but returned promises remain pending until you connect.
Node session:
> client = new pg.Client(URL)
Client { ... }
> client.query('select now()')
.then(r => console.log('result', r))
.catch(e => console.log('error', e))
Promise { <pending>, ... }
// wait a while ...
> client.connect()
Promise { <pending>, ... }
result Result { rows: ... }
Tweeted: https://twitter.com/jawj/status/1602667209591078914, https://twitter.com/jawj/status/1602668515718225924
OK, I'm closing this. The driver seems to behave the same way as ordinary pg when calling query
before connect
on Client
. And calling query
on Pool
also seems to work fine.
Tweets: https://twitter.com/_alexblokh/status/1602740964627456004, https://twitter.com/jawj/status/1602804020392992768, https://twitter.com/_alexblokh/status/1602904839939317760
Steps to reproduce
https://twitter.com/_alexblokh/status/1602397018445516807
didn't try to reproduce myself though