Skip to content
This repository has been archived by the owner on Sep 24, 2022. It is now read-only.

support sslcertsand other ssl based options on ConnOptions #44

Open
kolharsam opened this issue Jun 30, 2021 · 2 comments
Open

support sslcertsand other ssl based options on ConnOptions #44

kolharsam opened this issue Jun 30, 2021 · 2 comments

Comments

@kolharsam
Copy link

kolharsam commented Jun 30, 2021

Currently, on Hasura Cloud, we also support the connection of Postgres databases that require client-side SSL authentication. I wasn't sure if the connOptions

, connOptions :: !(Maybe String)
within the record type ConnOptions would be enough or we would need to handle it separately.

@kolharsam
Copy link
Author

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
Copy link
Contributor

jkachmar commented Mar 7, 2022

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:

  • add all of the connection parameters specified in the libpq documentation to ConnOptions
  • have a function that can convert between a Postgres URI and a ConnOptions-based connection string losslessly
    • this might involve adding more fields to ConnOptions or it might just involve constructing an intermediate type that can hold all of the query parameters that ConnOptions is incapable of expressing

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants