Skip to content

Commit 18fec1c

Browse files
authored
Support Swift.Set (#83)
1 parent 79da46b commit 18fec1c

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
extension Set: PostgresDataConvertible where Element: PostgresDataConvertible {
2+
public static var postgresDataType: PostgresDataType {
3+
[Element].postgresDataType
4+
}
5+
6+
public init?(postgresData: PostgresData) {
7+
guard let array = [Element](postgresData: postgresData) else {
8+
return nil
9+
}
10+
self = Set(array)
11+
}
12+
13+
public var postgresData: PostgresData? {
14+
[Element](self).postgresData
15+
}
16+
}

Tests/PostgresNIOTests/PostgresNIOTests.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ final class PostgresNIOTests: XCTestCase {
600600
}
601601

602602
func testRemoteTLSServer() throws {
603-
let url = "postgres://uymgphwj:7_tHbREdRwkqAdu4KoIS7hQnNxr8J1LA@elmer.db.elephantsql.com:5432/uymgphwj"
603+
// postgres://uymgphwj:7_tHbREdRwkqAdu4KoIS7hQnNxr8J1LA@elmer.db.elephantsql.com:5432/uymgphwj
604604
let elg = MultiThreadedEventLoopGroup(numberOfThreads: 1)
605605
defer { try! elg.syncShutdownGracefully() }
606606

@@ -793,8 +793,6 @@ final class PostgresNIOTests: XCTestCase {
793793
let conn = try PostgresConnection.test(on: eventLoop).wait()
794794
defer { try! conn.close().wait() }
795795

796-
let now = Date()
797-
let uuid = UUID()
798796
try prepareTableToMeasureSelectPerformance(
799797
rowCount: 300_000, batchSize: 5_000,
800798
schema:

0 commit comments

Comments
 (0)