Reference

Extended promises

These promises are essentially the same as Q promises with the exception that you
can also use methods from this library just like when chaining methods in
synchronic code. Just remember to pass on the instance of PostgreSQL in your
own promise functions (as you would need to do when chaining in synchronic
code).