MCPcopy
hub / github.com/go-sql-driver/mysql / initDB

Function initDB

benchmark_test.go:49–62  ·  view source on GitHub ↗
(b *testing.B, compress bool, queries ...string)

Source from the content-addressed store, hash-verified

47}
48
49func initDB(b *testing.B, compress bool, queries ...string) *sql.DB {
50 tb := (*TB)(b)
51 comprStr := ""
52 if compress {
53 comprStr = "&compress=1"
54 }
55 db := tb.checkDB(sql.Open(driverNameTest, dsn+comprStr))
56 for _, query := range queries {
57 if _, err := db.Exec(query); err != nil {
58 b.Fatalf("error on %q: %v", query, err)
59 }
60 }
61 return db
62}
63
64const concurrencyLevel = 10
65

Callers 6

benchmarkQueryFunction · 0.85
BenchmarkQueryContextFunction · 0.85
BenchmarkExecContextFunction · 0.85
BenchmarkQueryRawBytesFunction · 0.85
benchmark10kRowsFunction · 0.85
BenchmarkReceiveMetadataFunction · 0.85

Calls 3

checkDBMethod · 0.80
OpenMethod · 0.80
ExecMethod · 0.45

Tested by

no test coverage detected