MCPcopy Create free account
hub / github.com/cloudflare/cfssl / MySQLDB

Function MySQLDB

certdb/testdb/testdb.go:44–59  ·  view source on GitHub ↗

MySQLDB returns a MySQL db instance for certdb testing.

()

Source from the content-addressed store, hash-verified

42
43// MySQLDB returns a MySQL db instance for certdb testing.
44func MySQLDB() *sqlx.DB {
45 connStr := "root@tcp(localhost:3306)/certdb_development?parseTime=true"
46
47 if dbURL := os.Getenv("DATABASE_URL"); dbURL != "" {
48 connStr = dbURL
49 }
50
51 db, err := sqlx.Open("mysql", connStr)
52 if err != nil {
53 panic(err)
54 }
55
56 Truncate(db)
57
58 return db
59}
60
61// PostgreSQLDB returns a PostgreSQL db instance for certdb testing.
62func PostgreSQLDB() *sqlx.DB {

Callers 1

TestMySQLFunction · 0.92

Calls 2

TruncateFunction · 0.85
OpenMethod · 0.45

Tested by 1

TestMySQLFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…