[support] Callback for initial connection
Closed this issue · 1 comments
cohix commented
I would like to know if there is a way to supply a callback to the .configure()
function such that I can detect db connection errors immediately.
e.g.
var db = require('pg-bricks').configure('postgres://localhost/db_name', function(err)
{
if(err) {....}
});
Any help is appreciated.
Suor commented
In current design this is impossible to achieve. First, connection is established lazily, when it's needed, so you will get connection error in response to .run()
or other call. Second, connection pooling as used, so more connections not just first are established as needed.
Why do you want that anyway?