Open kolharsam opened 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
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:
libpq
documentation to ConnOptions
URI
and a ConnOptions
-based connection string losslessly
ConnOptions
or it might just involve constructing an intermediate type that can hold all of the query parameters that ConnOptions
is incapable of expressing
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
https://github.com/hasura/pg-client-hs/blob/f46db20938ea23583961b66d30b74a94642be4be/src/Database/PG/Query/Connection.hs#L71 within the record typeConnOptions
would be enough or we would need to handle it separately.