-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pgxstore expects a *pgxpool.Pool instead of a *sql.DB #184
Comments
To add to the issue description, one could definitely switch to using |
I guess another alternative would be to just use the postgresstore but instead of using I'll give it a try and report back. Maybe this is something that can be clarified in the README as well 😊 |
I am using the pgx driver via the jackc/pgx/v5/stdlib interface to make it compatible to sqlx at. al., this works fine with postgresstore for scs. You can always get the pgx handle from the DB interface if you are so inclined to use the pgx interface. |
👍 Same, I can confirm that I've been running the I'd be happy to open a quick PR to make that clarification if we agree 😊 |
@tiagonbotelho Thanks, that sounds good to me 👍 It would be great if you could update the README for postgresstore to include examples of both using it with pq and also jackc/pgx/v5/stdlib. If we're making that change, we should probably update the table in the main SCS README at https://github.com/alexedwards/scs/tree/master#configuring-the-session-store too. |
Hello,
I'm following along the Let's Go book (amazing book btw 🎉 ) and trying to adapt the code to use Postgres rather than MySQL.
However, one of the challenges I've encountered is that the session store that
scs
uses for Postgres (pgxstore
) doesn't support the usage of thedatabase/sql
package (unlike the MySQL counterpart), since it expects a*pgxpool.Pool
to be passed rather than a*sql.DB
.Since it seems to be a best practice to use the higher-level wrapper such as
database/sql
rather than a driver-specific library, I was wondering if there'd be any appetite in adding support for passing*sql.DB
topgxstore.New()
Thanks again for all the amazing contributions to the Go language 👏
The text was updated successfully, but these errors were encountered: