Skip to content

Commit 50e3097

Browse files
authored
Merge pull request #59 from bygri/master
Vapor to respect option files like my.cnf
2 parents 3f53190 + dc8fd25 commit 50e3097

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/MySQL/Connection.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@ public final class Connection {
3232
port: UInt32,
3333
socket: String?,
3434
flag: UInt,
35-
encoding: String
35+
encoding: String,
36+
optionsGroupName: String = "vapor"
3637
) throws {
3738
mysql_thread_init()
3839
cConnection = mysql_init(nil)
3940

41+
mysql_options(cConnection, MYSQL_READ_DEFAULT_GROUP, optionsGroupName)
42+
4043
guard mysql_real_connect(cConnection, host, user, password, database, port, socket, flag) != nil else {
4144
throw Error.connection(error)
4245
}

0 commit comments

Comments
 (0)