Skip to content

Commit cc36d37

Browse files
committed
postgres client updates
1 parent 19fd35b commit cc36d37

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Sources/PostgresKit/PostgresDatabase.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ struct PostgresDialect: SQLDialect {
163163
}
164164

165165
extension PostgresConnection: SQLDatabase { }
166-
extension SQLDatabase where Self: PostgresDatabase {
166+
extension SQLDatabase where Self: PostgresClient {
167167
public func sqlQuery(_ query: SQLExpression, _ onRow: @escaping (SQLRow) throws -> ()) -> EventLoopFuture<Void> {
168168
var serializer = SQLSerializer(dialect: PostgresDialect())
169169
query.serialize(to: &serializer)
@@ -176,7 +176,7 @@ extension SQLDatabase where Self: PostgresDatabase {
176176
}
177177

178178
#warning("TODO: move to NIOPostgres?")
179-
extension ConnectionPool: PostgresDatabase where Source.Connection: PostgresDatabase {
179+
extension ConnectionPool: PostgresClient where Source.Connection: PostgresClient {
180180
public var eventLoop: EventLoop {
181181
return self.source.eventLoop
182182
}

Tests/PostgresKitTests/PostgresKitTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class PostgresKitTests: XCTestCase {
2020

2121
func testSQLKitBenchmark() throws {
2222
let conn = try PostgresConnection.test(on: self.eventLoop).wait()
23+
defer { try! conn.close().wait() }
2324
let benchmark = SQLBenchmarker(on: conn)
2425
try benchmark.run()
2526
}
@@ -30,6 +31,7 @@ class PostgresKitTests: XCTestCase {
3031
on: self.eventLoop
3132
)
3233
let pool = ConnectionPool(config: .init(maxConnections: 12), source: db)
34+
defer { try! pool.close().wait() }
3335
self.measure {
3436
for i in 1...100 {
3537
_ = try! pool.withConnection { conn in

0 commit comments

Comments
 (0)