Open

Description
The pool.end callback/promise should resolve after the last pool.query resolves but instead it always resolves just before the last query:
pool.query(query).then(() => console.log('done'))
pool.query(query).then(() => console.log('done'))
pool.query(query).then(() => console.log('done'))
pool.end().then(() => console.log('end'))
result:
done
done
end
done
it needs to resolve after to signal that all query callbacks have run
another example of this occurring is in PR #2149 (comment)
I have not looked at solution again yet but maybe can sometime coming up, or anyone else feel free to fix