From c794dd313da6f86d991c3b901757f853cb16bf12 Mon Sep 17 00:00:00 2001 From: Tanner Date: Thu, 24 Oct 2019 21:59:44 -0400 Subject: [PATCH] beta 1 (#241) --- Package.swift | 4 ++-- Sources/MySQLKit/MySQLDatabase.swift | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Package.swift b/Package.swift index 9dd55cde..2f762c91 100644 --- a/Package.swift +++ b/Package.swift @@ -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: [ diff --git a/Sources/MySQLKit/MySQLDatabase.swift b/Sources/MySQLKit/MySQLDatabase.swift index bb1f0c2e..9cd370e1 100644 --- a/Sources/MySQLKit/MySQLDatabase.swift +++ b/Sources/MySQLKit/MySQLDatabase.swift @@ -64,20 +64,18 @@ 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 { + public func makeConnection(on eventLoop: EventLoop) -> EventLoopFuture { let address: SocketAddress do { address = try self.configuration.address() } catch { - return self.eventLoop.makeFailedFuture(error) + return eventLoop.makeFailedFuture(error) } return MySQLConnection.connect( to: address, @@ -85,7 +83,7 @@ public struct MySQLConnectionSource: ConnectionPoolSource { database: self.configuration.database ?? self.configuration.username, password: self.configuration.password, tlsConfiguration: self.configuration.tlsConfiguration, - on: self.eventLoop + on: eventLoop ) } }