Closed AprilArcus closed 9 years ago
I'm not able to test the code at the moment, but from what I can see it makes sense.
I'll merge it, but do you think you could also write a test for it that ensures a new connection is attempted if you don't pass in one, and not attempted if you do? My current tests are awful but I'd like a test that covers this PR at any rate.
When using
koa-pg-session
in conjunction withkoa-pg
, it can be desirable to share a singleco-pg
client pool among both sessions table access and generic database queries -- in particular for small setups where the sessions table and other tables are running on the same postgres server. This PR allows aco-pg
object to be passed in to thePgSession
constructor: