rightfold / purescript-postgresql-client

https://pursuit.purescript.org/packages/purescript-postgresql-client
BSD 3-Clause "New" or "Revised" License
35 stars 20 forks source link

Add sslmode to connection config #51

Closed leomayleomay closed 4 years ago

leomayleomay commented 4 years ago

This PR is to add sslmode to connection config so that the user of the package could specify sslmode=require as described in https://devcenter.heroku.com/articles/connecting-to-heroku-postgres-databases-from-outside-of-heroku#ssl

leomayleomay commented 4 years ago

just I could achieve the same with export PGSSLMODE=require

paluh commented 4 years ago

Hi,

Thanks for this proposition.

It seems that node-postgres supports ssl :: Boolean option for this kind of configuration:

https://github.com/brianc/node-postgres/blob/ff302b10cea27caf39fa446220a0f7f93c179a09/packages/pg/test/unit/client/configuration-tests.js#L27

It would be nice to have it (I think we want to have ssl :: Maybe Boolean) because we want to preserve possibility to use default value on the pg level.

On the other hand it seems that postgresql supports more options here then there is on the node-postgres side:

https://www.postgresql.org/docs/9.3/libpq-connect.html#LIBPQ-CONNECT-SSLMODE

This leaves an open question if we want to really parse connection uri on our side like it is done now...