diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java index 47c4692b25..1bbbbb0939 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java @@ -1518,6 +1518,12 @@ public Builder useClientCert(String host, String clientCertificate, String clien return this; } + public Builder usePlainText() { + this.setChannelConfigurator(ManagedChannelBuilder::usePlaintext); + this.setCredentials(NoCredentials.getInstance()); + return this; + } + /** * Sets OpenTelemetry object to be used for Spanner Metrics and Traces. GlobalOpenTelemetry will * be used as fallback if this options is not set.