Closed abgeana closed 3 years ago
Is there a reason why this store uses a single connection, instead of accepting the entire pgxpool?
@abgeana I'm really sorry, somehow I completely missed this PR.
I will review in the next few days and merge.
Thank you!
@alexedwards @abgeana Why was my comment about using a single connection ignored? No pgx app I've used has done pgx.Connect(), they all use pgxpool like pgx recommends, so at least the example in the README isn't realistic. Holding a single connection is typically only needed when some kind of SQL-level locking is done (e.g. for migrations).
I needed to use scs in a project of mine where the implemented use case was enough. I do not know of other use cases, or how (un-)realistic the example in the README is. That is the reason why the store uses a single connection.
@bojanz Your comment has not been ignored. I'm working on adapting the pgxstore to use a pool right now.
Awesome, thank you. Just wanted to make sure we're moving in the right direction.
@bojanz This is now done and everything seems to be working correctly with a connection pool. I committed the change a while ago, but wanted to wait until the old version was cleared from the Go module proxy before confirming.
pgxstore is a session store for postgresql based on the github.com/jackc/pgx package. The implementation is almost identical to the existing postgresstore package, with the only difference being the postgresql driver.