(b *testing.B)
| 1093 | } |
| 1094 | |
| 1095 | func BenchmarkSelectRowsPgConnExecText(b *testing.B) { |
| 1096 | conn := mustConnectString(b, os.Getenv("PGX_TEST_DATABASE")) |
| 1097 | defer closeConn(b, conn) |
| 1098 | |
| 1099 | rowCounts := getSelectRowsCounts(b) |
| 1100 | |
| 1101 | for _, rowCount := range rowCounts { |
| 1102 | b.Run(fmt.Sprintf("%d rows", rowCount), func(b *testing.B) { |
| 1103 | for b.Loop() { |
| 1104 | mrr := conn.PgConn().Exec(context.Background(), fmt.Sprintf("select n, 'Adam', 'Smith ' || n, 'male', '1952-06-16'::date, 258, 72, '{foo,bar,baz}'::text[], '2001-01-28 01:02:03-05'::timestamptz from generate_series(100001, 100000 + %d) n", rowCount)) |
| 1105 | for mrr.NextResult() { |
| 1106 | rr := mrr.ResultReader() |
| 1107 | for rr.NextRow() { |
| 1108 | rr.Values() |
| 1109 | } |
| 1110 | } |
| 1111 | |
| 1112 | err := mrr.Close() |
| 1113 | if err != nil { |
| 1114 | b.Fatal(err) |
| 1115 | } |
| 1116 | } |
| 1117 | }) |
| 1118 | } |
| 1119 | } |
| 1120 | |
| 1121 | func BenchmarkSelectRowsPgConnExecParams(b *testing.B) { |
| 1122 | conn := mustConnectString(b, os.Getenv("PGX_TEST_DATABASE")) |
nothing calls this directly
no test coverage detected