(b *testing.B)
| 56 | } |
| 57 | |
| 58 | func BenchmarkMinimalUnpreparedSelectWithStatementCacheModeDescribe(b *testing.B) { |
| 59 | config := mustParseConfig(b, os.Getenv("PGX_TEST_DATABASE")) |
| 60 | config.DefaultQueryExecMode = pgx.QueryExecModeCacheDescribe |
| 61 | config.StatementCacheCapacity = 0 |
| 62 | config.DescriptionCacheCapacity = 32 |
| 63 | |
| 64 | conn := mustConnect(b, config) |
| 65 | defer closeConn(b, conn) |
| 66 | |
| 67 | var n int64 |
| 68 | |
| 69 | for i := 0; b.Loop(); i++ { |
| 70 | err := conn.QueryRow(context.Background(), "select $1::int8", i).Scan(&n) |
| 71 | if err != nil { |
| 72 | b.Fatal(err) |
| 73 | } |
| 74 | |
| 75 | if n != int64(i) { |
| 76 | b.Fatalf("expected %d, got %d", i, n) |
| 77 | } |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | func BenchmarkMinimalUnpreparedSelectWithStatementCacheModePrepare(b *testing.B) { |
| 82 | config := mustParseConfig(b, os.Getenv("PGX_TEST_DATABASE")) |
nothing calls this directly
no test coverage detected