Skip to content

Commit 456b1b3

Browse files
committed
Add support for configuring connections via UNIX domain socket
1 parent 97a62ce commit 456b1b3

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Sources/MySQLBridge/Extensions/DatabaseHost+Initialization.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,16 @@ extension DatabaseHost {
4444

4545
self.init(hostname: hostname, port: port, username: username, password: password, tlsConfiguration: tlsConfiguration)
4646
}
47+
48+
public init(
49+
unixDomainSocketPath: String,
50+
username: String,
51+
password: String,
52+
database: String
53+
) {
54+
let address = {
55+
try SocketAddress.init(unixDomainSocketPath: unixDomainSocketPath)
56+
}
57+
self.init(address: address, username: username, password: password, tlsConfiguration: nil)
4758
}
4859
}

0 commit comments

Comments
 (0)