Optional
onA callback for when a new connection has been established.
This is mainly for logging purposes / diagnostics.
New pg-promise
connection object.
Number of times the connection has been established.
Optional
onA callback function that is invoked when a disconnection event occurs i.e. when the connection has been lost temporarily.
This is mainly for logging purposes / diagnostics.
The error object pertaining to the disconnection issue.
The context associated with the disconnection, providing additional details or state information.
Optional
onA callback function that is invoked when a reconnection attempt fails.
Receiving this event means that the connection has been lost permanently, and the library won't try to auto-reconnect again, i.e. you would need to call PgListener.listen again for another connection attempt, or just exit the application.
The error object or information related to the failed reconnection attempt.
Optional
onA callback for receiving a notification message from Postgres.
Optional event handlers passed into PgListener.listen method.