Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide FromJSON ConnectInfo instance for easy configuration #149

Closed

Conversation

peterbecich
Copy link

I think it would be helpful to provide instance FromJSON ConnectInfo for reading ConnectInfo from JSON or YAML.

i.e. via loadYamlSettings: https://hackage.haskell.org/package/yaml-0.11.11.2/docs/Data-Yaml-Config.html#v:loadYamlSettings

@peterbecich
Copy link
Author

@phadej please review

@phadej
Copy link
Collaborator

phadej commented Jan 7, 2025

My quick review is:

  • I think this is a bad idea. Especially by using generics, but even if it were manually written instance, you are tying somewhat internal type of the library to possibly public interface. That creates maintenance problems.
  • There is true and better way: make people supply connection strings or urls. These are well documented https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING

@phadej phadej closed this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants