node-postgres icon indicating copy to clipboard operation
node-postgres copied to clipboard

Add config.query_timeout for query()

Open Paxa opened this issue 4 years ago • 5 comments

client.query('select pg_sleep(10)', {query_timeout: 5})
  .then(...)
  .catch(error => { e.message == 'Query read timeout' })

Solve #2652

Paxa avatar Nov 17 '21 07:11 Paxa

thanks for the PR! Could you rebase on current master as I've re-enabled CI (travis ci kept breaking). And then if you could please write a quick integration test for this so we can be sure it will continue to work in the future!

brianc avatar Nov 17 '21 17:11 brianc

Hi, thanks for reply, I'm afraid I don't have time to bring this PR to the right shape

Feel free to continue where I left

Paxa avatar Jul 17 '22 01:07 Paxa

Applied to lastest master https://github.com/Paxa/node-postgres/commit/03630e1a212518bfe0c751472cdd80f3fd7aa741

Paxa avatar Sep 03 '23 17:09 Paxa

@brianc What's needed for this to be released?

eladchen avatar Mar 22 '24 11:03 eladchen

Apologies. Been crazy spinning down my current job...I'll try to get this released today or tomorrow. Going forward, after a few weeks of vacation, you can expect much more prompt responses here.

brianc avatar Mar 28 '24 18:03 brianc