Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0a925f4

Browse files
authored
Replace hardcoded port number with PostgresConfiguration.ianaPortNumber. (#172)
1 parent 4acfbb9 commit 0a925f4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎Sources/FluentPostgresDriver/FluentPostgresConfiguration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extension DatabaseConfigurationFactory {
3737

3838
public static func postgres(
3939
hostname: String,
40-
port: Int = 5432,
40+
port: Int = PostgresConfiguration.ianaPortNumber,
4141
username: String,
4242
password: String,
4343
database: String? = nil,

‎Tests/FluentPostgresDriverTests/FluentPostgresDriverTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ final class FluentPostgresDriverTests: XCTestCase {
135135

136136
let configuration = PostgresConfiguration(
137137
hostname: env("POSTGRES_HOSTNAME_A") ?? "localhost",
138-
port: env("POSTGRES_PORT_A").flatMap(Int.init) ?? 5432,
138+
port: env("POSTGRES_PORT_A").flatMap(Int.init) ?? PostgresConfiguration.ianaPortNumber,
139139
username: "vapor_username",
140140
password: "vapor_password",
141141
database: env("POSTGRES_DATABASE_A") ?? "vapor_database"
@@ -181,14 +181,14 @@ final class FluentPostgresDriverTests: XCTestCase {
181181

182182
let aConfig = PostgresConfiguration(
183183
hostname: env("POSTGRES_HOSTNAME_A") ?? "localhost",
184-
port: env("POSTGRES_PORT_A").flatMap(Int.init) ?? 5432,
184+
port: env("POSTGRES_PORT_A").flatMap(Int.init) ?? PostgresConfiguration.ianaPortNumber,
185185
username: env("POSTGRES_USERNAME_A") ?? "vapor_username",
186186
password: env("POSTGRES_PASSWORD_A") ?? "vapor_password",
187187
database: env("POSTGRES_DATABASE_A") ?? "vapor_database"
188188
)
189189
let bConfig = PostgresConfiguration(
190190
hostname: env("POSTGRES_HOSTNAME_B") ?? "localhost",
191-
port: env("POSTGRES_PORT_B").flatMap(Int.init) ?? 5432,
191+
port: env("POSTGRES_PORT_B").flatMap(Int.init) ?? PostgresConfiguration.ianaPortNumber,
192192
username: env("POSTGRES_USERNAME_B") ?? "vapor_username",
193193
password: env("POSTGRES_PASSWORD_B") ?? "vapor_password",
194194
database: env("POSTGRES_DATABASE_B") ?? "vapor_database"

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /