Skip to content

Commit

Permalink
Add ability to connect via UNIX socket (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
devslashwill authored Feb 12, 2020
1 parent d70f50b commit 1990fbf
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Sources/PostgresKit/PostgresConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,26 @@ public struct PostgresConfiguration {
tlsConfiguration: tlsConfiguration
)
}

public init(
unixDomainSocketPath: String,
username: String,
password: String,
database: String,
encoder: PostgresDataEncoder = PostgresDataEncoder(),
decoder: PostgresDataDecoder = PostgresDataDecoder()
) {
self.address = {
return try SocketAddress.init(unixDomainSocketPath: unixDomainSocketPath)
}
self.username = username
self.password = password
self.database = database
self.tlsConfiguration = nil
self._hostname = nil
self.encoder = encoder
self.decoder = decoder
}

public init(
hostname: String,
Expand Down

0 comments on commit 1990fbf

Please sign in to comment.