blob: c973a4d38447cd06fb228eefda188caee2a92a50 [file] [log] [blame]
package sql
import "os"
// cockroachDBEmulatorHostEnvVar is the name of the environment variable
// that points to a test instance of CockroachDB.
const cockroachDBEmulatorHostEnvVar = "COCKROACHDB_EMULATOR_HOST"
// GetCockroachDBEmulatorHost returns the connection string to connect to a
// local test instance of CockroachDB.
func GetCockroachDBEmulatorHost() string {
ret := os.Getenv(cockroachDBEmulatorHostEnvVar)
if ret == "" {
ret = "localhost:26257"
}
return ret
}