Skip to content

Commit

Permalink
Merge pull request #59 from bygri/master
Browse files Browse the repository at this point in the history
Vapor to respect option files like my.cnf
  • Loading branch information
tanner0101 authored Oct 18, 2016
2 parents 3f53190 + dc8fd25 commit 50e3097
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/MySQL/Connection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ public final class Connection {
port: UInt32,
socket: String?,
flag: UInt,
encoding: String
encoding: String,
optionsGroupName: String = "vapor"
) throws {
mysql_thread_init()
cConnection = mysql_init(nil)

mysql_options(cConnection, MYSQL_READ_DEFAULT_GROUP, optionsGroupName)

guard mysql_real_connect(cConnection, host, user, password, database, port, socket, flag) != nil else {
throw Error.connection(error)
}
Expand Down

0 comments on commit 50e3097

Please sign in to comment.