-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
What do you think about adding an optional callback function to the Client.prototype.connect
function?
pg = require "pg"
client = new pg.Client "pg://postgres:testing@localhost/orm"
client.connect (error, client) ->
if error then console.log error
else
console.log "connected (callback)"
client.end()
client.on "connect", ->
#never reached
console.log "connected..."
client.end()
client.on "error", (error) ->
#only for errors afther connect event
console.log error
I prepared a patch. Maybe you can take a look and tell me where the best place for test is.
Regards
Philipp
Metadata
Metadata
Assignees
Labels
No labels