haskellari / postgresql-simple

Mid-level client library for accessing PostgreSQL from Haskell
Other
88 stars 46 forks source link

Support arbitrary options in ConnectInfo #91

Open brandon-leapyear opened 2 years ago

brandon-leapyear commented 2 years ago

It would be nice to specify extra options like sslmode in ConnectInfo like

ConnectInfo
  { extraOptions = [("sslmode", "verify-full")]
  }

Currently, you have to go into the source code, figure out if postgreSQLConnectionString uses postgresql://... syntax or k=v syntax, then manually add the options, which could break if postgreSQLConnectionString changes the format

https://www.postgresql.org/docs/9.5/libpq-connect.html#LIBPQ-CONNSTRING