wrench icon indicating copy to clipboard operation
wrench copied to clipboard

Option to define emulator host from Config

Open PumpkinSeed opened this issue 2 years ago • 1 comments

WHAT

Make it possible to pass the Emulator host in the Config.

// example
cfg := wrenchSpanner.Config{
	Project:  "project",
	Instance: "instance",
	Database: "database",
	EmulatorHost: "localhost:9091",
}
spannerCli, err := wrenchSpanner.NewClient(ctx, &cfg)

WHY

Currently if we want to define an emulator host, we need to set the SPANNER_EMULATOR_HOST. Those who using the tool as library it is pretty hard to maintain, because we need to call os.Setenv, which is a pretty bad practices in case of testing.

Edit, in case of approval, I will be happy to work on it.

PumpkinSeed avatar Feb 21 '23 10:02 PumpkinSeed

It seems good. It's welcome to your contribution. I will review if you create a PR.

kazegusuri avatar Mar 05 '23 15:03 kazegusuri