func (n *Node) openDB(addr string) (*client.DB, error) { db, err := client.Open(addr, n.cfg.User, n.cfg.Password, "") if err != nil { return nil, err } db.SetIdleConns(n.cfg.IdleConns) return db, nil }
func newTestDB(t *testing.T) *client.DB { newTestServer(t) f := func() { var err error testDB, err = client.Open("127.0.0.1:4000", "root", "", "mixer") if err != nil { t.Fatal(err) } testDB.SetIdleConns(4) } testDBOnce.Do(f) return testDB }