Query timeout in pg-promise
I want to add timeout to pg-promise queries so they will fail after some amount of time if database have not yet responded. Is there any recommended way to do that or should I make custom wrapper that will handle timer and reject promise if it's too late? From the author of pg-promise ... pg-promise doesn't support query cancellation, because it is a hack to work-around incorrect database design or bad query execution. PostgreSQL supports events that should be used when executing time-consuming queries, so instead of waiting, one can set an event listener to be triggered when specific data