Skip to content

Conversation

@seeppp
Copy link

@seeppp seeppp commented May 7, 2020

A user should be able to call PostgresConfiguration(url:tlsConfiguration:).

In environment like Heroku, where only a DATABASE_URL is given and some databases required SSL on, we should be able to add the TLSConfiguration right on when creating the PostgresConfiguration. Simply adding sslmode=require to the URL does not work as the default TLSConfiguration has TLS verification on.

Related to #186.

A user whould be able to call `.init(url:tlsConfiguration:)`
@tanner0101 tanner0101 added the enhancement New feature or request label May 20, 2020
Copy link
Member

@tanner0101 tanner0101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about doing something like this instead (which is possible without any changes):

var config = PostgresConfiguration(url: ...)!
config.tlsConfiguration = ...

This usage seems clearer to me especially given that the URL can contain TLS configuration info. In the above example I'm clearly overwriting whatever TLS configuration the url contained with a custom one.

@seeppp
Copy link
Author

seeppp commented May 20, 2020

Okay, that works too. That's why I opened up another PR with the postgress-driver who does what you recommend: vapor/fluent-postgres-driver#153

@tanner0101
Copy link
Member

@tanner0101 tanner0101 closed this May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants