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

Function PostgreSQLDB

certdb/testdb/testdb.go:62–77  ·  view source on GitHub ↗

PostgreSQLDB returns a PostgreSQL db instance for certdb testing.

()

Source from the content-addressed store, hash-verified

60
61// PostgreSQLDB returns a PostgreSQL db instance for certdb testing.
62func PostgreSQLDB() *sqlx.DB {
63 connStr := "dbname=certdb_development sslmode=disable user=postgres"
64
65 if dbURL := os.Getenv("DATABASE_URL"); dbURL != "" {
66 connStr = dbURL
67 }
68
69 db, err := sqlx.Open("postgres", connStr)
70 if err != nil {
71 panic(err)
72 }
73
74 Truncate(db)
75
76 return db
77}
78
79// SQLiteDB returns a SQLite db instance for certdb testing.
80func SQLiteDB(dbpath string) *sqlx.DB {

Callers 1

TestPostgreSQLFunction · 0.92

Calls 2

TruncateFunction · 0.85
OpenMethod · 0.45

Tested by 1

TestPostgreSQLFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…