hasura / pg-client-hs

A low level Haskell library to connect to postgres
Apache License 2.0
25 stars 15 forks source link

support `sslcerts`and other ssl based options on `ConnOptions` #44

Open kolharsam opened 3 years ago

kolharsam commented 3 years ago

Currently, on Hasura Cloud, we also support the connection of Postgres databases that require client-side SSL authentication. I wasn't sure if the connOptionshttps://github.com/hasura/pg-client-hs/blob/f46db20938ea23583961b66d30b74a94642be4be/src/Database/PG/Query/Connection.hs#L71 within the record type ConnOptions would be enough or we would need to handle it separately.

kolharsam commented 3 years ago

Saving a reference to @jkachmar's comment here which is related to this issue: https://github.com/hasura/graphql-engine-mono/pull/1690#discussion_r661892351

jkachmar commented 2 years ago

Copying over the relevant context for pg-client-hs from the parent comment mentioned above.


Currently, the code paths involved in graphql-engine all assume that Postgres connection info is only ever expressed and handled as a URI. pg-client-hs uses ConnDetails to express that it can handle either a URI or a record of connection parameters which can be used to construct a connection string (cf. the libpq reference docs for details).

I think it would be much nicer if we could extend pg-client-hs roughly as follows: