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

added connection string parsing for PostgreSQLDatabaseConfig #25

Merged
merged 2 commits into from Mar 14, 2018

Conversation

2 participants
@pedantix
Copy link
Member

pedantix commented Mar 6, 2018

No description provided.

@tanner0101 tanner0101 added this to the 1.0.0-rc.2 milestone Mar 7, 2018

@tanner0101 tanner0101 self-assigned this Mar 7, 2018

@@ -29,4 +30,25 @@ public struct PostgreSQLDatabaseConfig {
self.database = database
self.password = password
}

public init(connectionString: String) throws {

This comment has been minimized.

@tanner0101

tanner0101 Mar 7, 2018

Member

param label can probably just be url here.
also a doc comment with example would be awesome

@tanner0101
Copy link
Member

tanner0101 left a comment

lgtm! just some formatting things


/// Creates a `PostgreSQLDatabaseConfig` frome a connection string.
public init(url: String) throws {
guard let urL = URL(string: url),

This comment has been minimized.

@tanner0101

tanner0101 Mar 12, 2018

Member

you can name it url here. It will override the url from the init

This comment has been minimized.

@tanner0101

tanner0101 Mar 12, 2018

Member

Or name it _url

else {
throw PostgreSQLError(identifier: "Bad Connection String",
reason: "Host could not be parsed",
possibleCauses: ["Foundation URL is unable to parse the provided connection string"],

This comment has been minimized.

@tanner0101

tanner0101 Mar 12, 2018

Member

xcode formatting 😁

@tanner0101 tanner0101 merged commit c2b4be0 into vapor:nio Mar 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment