Skip to content

Commit 92881d8

Browse files
committed
add PostgresDataEncoder
1 parent 975cc8b commit 92881d8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Tests/PostgreSQLTests/PostgreSQLConnectionTests.swift

+18
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,24 @@ class PostgreSQLConnectionTests: XCTestCase {
588588
XCTAssert(result == Double(value))
589589
}
590590
}
591+
592+
func testRangeSelectDecodePerformance() throws {
593+
struct Series: Decodable {
594+
var num: Int
595+
}
596+
597+
let conn = try PostgreSQLConnection.makeTest()
598+
measure {
599+
let decoder = PostgreSQLRowDecoder()
600+
do {
601+
try conn.simpleQuery("SELECT * FROM generate_series(1, 10000) num") { row in
602+
_ = try decoder.decode(Series.self, from: row)
603+
}.wait()
604+
} catch {
605+
XCTFail("\(error)")
606+
}
607+
}
608+
}
591609

592610
static var allTests = [
593611
("testBenchmark", testBenchmark),

0 commit comments

Comments
 (0)