Skip to content

Commit

Permalink
beta 1 (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 authored Oct 25, 2019
1 parent 03e1e6b commit c794dd3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/vapor/mysql-nio.git", from: "1.0.0-alpha"),
.package(url: "https://github.com/vapor/sql-kit.git", from: "3.0.0-alpha"),
.package(url: "https://github.com/vapor/async-kit.git", from: "1.0.0-alpha"),
.package(url: "https://github.com/vapor/sql-kit.git", from: "3.0.0-beta"),
.package(url: "https://github.com/vapor/async-kit.git", from: "1.0.0-beta"),

],
targets: [
Expand Down
10 changes: 4 additions & 6 deletions Sources/MySQLKit/MySQLDatabase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,28 +64,26 @@ public struct MySQLConfiguration {
}

public struct MySQLConnectionSource: ConnectionPoolSource {
public var eventLoop: EventLoop
public let configuration: MySQLConfiguration

public init(configuration: MySQLConfiguration, on eventLoop: EventLoop) {
public init(configuration: MySQLConfiguration) {
self.configuration = configuration
self.eventLoop = eventLoop
}

public func makeConnection() -> EventLoopFuture<MySQLConnection> {
public func makeConnection(on eventLoop: EventLoop) -> EventLoopFuture<MySQLConnection> {
let address: SocketAddress
do {
address = try self.configuration.address()
} catch {
return self.eventLoop.makeFailedFuture(error)
return eventLoop.makeFailedFuture(error)
}
return MySQLConnection.connect(
to: address,
username: self.configuration.username,
database: self.configuration.database ?? self.configuration.username,
password: self.configuration.password,
tlsConfiguration: self.configuration.tlsConfiguration,
on: self.eventLoop
on: eventLoop
)
}
}
Expand Down

0 comments on commit c794dd3

Please sign in to comment.