diff --git a/Sources/PostgresNIO/Data/PostgresData+Set.swift b/Sources/PostgresNIO/Data/PostgresData+Set.swift new file mode 100644 index 00000000..1a7cd0c1 --- /dev/null +++ b/Sources/PostgresNIO/Data/PostgresData+Set.swift @@ -0,0 +1,16 @@ +extension Set: PostgresDataConvertible where Element: PostgresDataConvertible { + public static var postgresDataType: PostgresDataType { + [Element].postgresDataType + } + + public init?(postgresData: PostgresData) { + guard let array = [Element](postgresData: postgresData) else { + return nil + } + self = Set(array) + } + + public var postgresData: PostgresData? { + [Element](self).postgresData + } +} diff --git a/Tests/PostgresNIOTests/PostgresNIOTests.swift b/Tests/PostgresNIOTests/PostgresNIOTests.swift index ba055045..49680a12 100644 --- a/Tests/PostgresNIOTests/PostgresNIOTests.swift +++ b/Tests/PostgresNIOTests/PostgresNIOTests.swift @@ -600,7 +600,7 @@ final class PostgresNIOTests: XCTestCase { } func testRemoteTLSServer() throws { - let url = "postgres://uymgphwj:7_tHbREdRwkqAdu4KoIS7hQnNxr8J1LA@elmer.db.elephantsql.com:5432/uymgphwj" + // postgres://uymgphwj:7_tHbREdRwkqAdu4KoIS7hQnNxr8J1LA@elmer.db.elephantsql.com:5432/uymgphwj let elg = MultiThreadedEventLoopGroup(numberOfThreads: 1) defer { try! elg.syncShutdownGracefully() } @@ -793,8 +793,6 @@ final class PostgresNIOTests: XCTestCase { let conn = try PostgresConnection.test(on: eventLoop).wait() defer { try! conn.close().wait() } - let now = Date() - let uuid = UUID() try prepareTableToMeasureSelectPerformance( rowCount: 300_000, batchSize: 5_000, schema: