cloudspannerecosystem / wrench

wrench - Schema management tool for Cloud Spanner -
MIT License
239 stars 46 forks source link

pkg/spanner/client: Add optional option.ClientOption parameters to Ne… #72

Closed mskwon closed 1 year ago

mskwon commented 1 year ago

…wClient constructor

Fixes #59

WHAT

This changes the constructor signature for the wrench client so that client options can be passed to the wrapped spanner clients. As the options are passed as a variadic parameter, there is no impact on pre-existing code.

WHY

The ability to pass client options allows for the passing of option.WithGRPCConn. This makes it so that wrench will work with spannertest - an in-memory fake Cloud Spanner which can be used for unit tests.

google-cla[bot] commented 1 year ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

kazegusuri commented 1 year ago

Please sign the CLA.

mskwon commented 1 year ago

Apologies for the delay here

mskwon commented 1 year ago

Bump

kazegusuri commented 1 year ago

Thank you for making this PR. I thought the option should be inside the wrench's config struct instead of first type options because it's the Spanner specific options. I create another PR on the top of your commit.

kazegusuri commented 1 year ago

Ah I need to merge this PR first to use your commit because we can't use other merge options except squash and merge.