(b *testing.B)
| 159 | } |
| 160 | |
| 161 | func BenchmarkMinimalPgConnPreparedStatementDescriptionSelect(b *testing.B) { |
| 162 | conn := mustConnect(b, mustParseConfig(b, os.Getenv("PGX_TEST_DATABASE"))) |
| 163 | defer closeConn(b, conn) |
| 164 | |
| 165 | pgConn := conn.PgConn() |
| 166 | |
| 167 | psd, err := pgConn.Prepare(context.Background(), "ps1", "select $1::int8", nil) |
| 168 | if err != nil { |
| 169 | b.Fatal(err) |
| 170 | } |
| 171 | |
| 172 | encodedBytes := make([]byte, 8) |
| 173 | |
| 174 | b.ResetTimer() |
| 175 | for i := 0; i < b.N; i++ { |
| 176 | |
| 177 | rr := pgConn.ExecStatement(context.Background(), psd, [][]byte{encodedBytes}, []int16{1}, []int16{1}) |
| 178 | if err != nil { |
| 179 | b.Fatal(err) |
| 180 | } |
| 181 | |
| 182 | for rr.NextRow() { |
| 183 | for i := range rr.Values() { |
| 184 | if !bytes.Equal(rr.Values()[0], encodedBytes) { |
| 185 | b.Fatalf("unexpected values: %s %s", rr.Values()[i], encodedBytes) |
| 186 | } |
| 187 | } |
| 188 | } |
| 189 | _, err = rr.Close() |
| 190 | if err != nil { |
| 191 | b.Fatal(err) |
| 192 | } |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | func BenchmarkPointerPointerWithNullValues(b *testing.B) { |
| 197 | conn := mustConnect(b, mustParseConfig(b, os.Getenv("PGX_TEST_DATABASE"))) |
nothing calls this directly
no test coverage detected