func ensureConnection(ctx context.Context) error {
	c := db.Config{}
	err := testutil.ResolveDBConfig(ctx, &c)
	if err != nil {
		return err
	}

	pool, err := db.New(db.OptConfig(c))
	if err != nil {
		return err
	}

	err = testutil.ValidatePool(ctx, pool, "")
	if err != nil {
		return err
	}

	return pool.Close()
}
// ensureConnection makes sure that a valid database connection exists
// before running tests. It uses the helpers **from this package** to
// configure and validation the connection, then closes it since further
// usage will not be needed.
ensureConnection makes sure that a valid database connection exists
before running tests. It uses the helpers **from this package** to
configure and validation the connection, then closes it since further
usage will not be needed.
// ensureConnection makes sure that a valid database connection exists // before running tests . It uses the helpers ** from this package ** to // configure and validation the connection then closes it since further // usage will not be needed .
func ensureConnection(ctx context.Context) error {
	c := db.Config{}
	err := testutil.ResolveDBConfig(ctx, &c)
	if err != nil {
		return err
	}
	pool, err := db.New(db.OptConfig(c))
	if err != nil {
		return err
	}
	err = testutil.ValidatePool(ctx, pool, "")
	if err != nil {
		return err
	}
	return pool.Close()
}
func ensureConnection ( ctx context . Context ) error { c := db . Config { } err := testutil . ResolveDBConfig ( ctx , & c ) if err != nil { return err } pool , err := db . New ( db . OptConfig ( c ) ) if err != nil { return err } err = testutil . ValidatePool ( ctx , pool , " " ) if err != nil { return err } return pool . Close ( ) }
ensureConnection makes sure that a valid database connection exists
before running tests.
ensureConnection makes sure that a valid database connection exists before running tests .