antonlindstrom/pgstore

support for different driver such as cloudsql postgres

0radek opened this issue · 3 comments

I am wondering if it would be possible to add support for additional drivers such as "github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/dialers/postgres"

It would be nice to have a way to pass the driver to https://github.com/antonlindstrom/pgstore/blob/master/pgstore.go#L40

In my app I load based on env flags, so dev would hit local database, but prod for example would use cloudpostgres.

Thanks

Hi! I think that should be possible as of existing code. If you implement the code in NewPGStore yourself and then pass the resulting sql.DB to NewPGStoreFromPool, it should hopefully work as intended.

Let me know if you run into any trouble with this and I will try to help (or make the necessary changes to make it work).

Cheers!

@antonlindstrom awesome! That works! Thank you so much for helping me with this issue, and thanks for making/maintaining this really cool project.

@ScaryWolfMan I'm glad I could help! Cheers! 👍