Skip to content

Commit 34221d7

Browse files
authored
docs: add descriptions for connection URL properties (#609)
Adds descriptions for the supported connection URL properties. These can be picked up by the JDBC driver and shown as descriptions for java.sql.DriverPropertyInfo.
1 parent 5135e50 commit 34221d7

File tree

1 file changed

+27
-9
lines changed

1 file changed

+27
-9
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,36 @@ public String[] getValidValues() {
183183
new HashSet<>(
184184
Arrays.asList(
185185
ConnectionProperty.createBooleanProperty(
186-
AUTOCOMMIT_PROPERTY_NAME, "", DEFAULT_AUTOCOMMIT),
186+
AUTOCOMMIT_PROPERTY_NAME,
187+
"Should the connection start in autocommit (true/false)",
188+
DEFAULT_AUTOCOMMIT),
187189
ConnectionProperty.createBooleanProperty(
188-
READONLY_PROPERTY_NAME, "", DEFAULT_READONLY),
190+
READONLY_PROPERTY_NAME,
191+
"Should the connection start in read-only mode (true/false)",
192+
DEFAULT_READONLY),
189193
ConnectionProperty.createBooleanProperty(
190-
RETRY_ABORTS_INTERNALLY_PROPERTY_NAME, "", DEFAULT_RETRY_ABORTS_INTERNALLY),
191-
ConnectionProperty.createStringProperty(CREDENTIALS_PROPERTY_NAME, ""),
192-
ConnectionProperty.createStringProperty(OAUTH_TOKEN_PROPERTY_NAME, ""),
193-
ConnectionProperty.createStringProperty(NUM_CHANNELS_PROPERTY_NAME, ""),
194+
RETRY_ABORTS_INTERNALLY_PROPERTY_NAME,
195+
"Should the connection automatically retry Aborted errors (true/false)",
196+
DEFAULT_RETRY_ABORTS_INTERNALLY),
197+
ConnectionProperty.createStringProperty(
198+
CREDENTIALS_PROPERTY_NAME,
199+
"The location of the credentials file to use for this connection. If this property is not set, the connection will use the default Google Cloud credentials for the runtime environment."),
200+
ConnectionProperty.createStringProperty(
201+
OAUTH_TOKEN_PROPERTY_NAME,
202+
"A valid pre-existing OAuth token to use for authentication for this connection. Setting this property will take precedence over any value set for a credentials file."),
203+
ConnectionProperty.createStringProperty(
204+
NUM_CHANNELS_PROPERTY_NAME,
205+
"The number of gRPC channels to use to communicate with Cloud Spanner. The default is 4."),
194206
ConnectionProperty.createBooleanProperty(
195-
USE_PLAIN_TEXT_PROPERTY_NAME, "", DEFAULT_USE_PLAIN_TEXT),
196-
ConnectionProperty.createStringProperty(USER_AGENT_PROPERTY_NAME, ""),
197-
ConnectionProperty.createStringProperty(OPTIMIZER_VERSION_PROPERTY_NAME, ""))));
207+
USE_PLAIN_TEXT_PROPERTY_NAME,
208+
"Use a plain text communication channel (i.e. non-TLS) for communicating with the server (true/false). Set this value to true for communication with the Cloud Spanner emulator.",
209+
DEFAULT_USE_PLAIN_TEXT),
210+
ConnectionProperty.createStringProperty(
211+
USER_AGENT_PROPERTY_NAME,
212+
"The custom user-agent property name to use when communicating with Cloud Spanner. This property is intended for internal library usage, and should not be set by applications."),
213+
ConnectionProperty.createStringProperty(
214+
OPTIMIZER_VERSION_PROPERTY_NAME,
215+
"Sets the default query optimizer version to use for this connection."))));
198216

199217
private static final Set<ConnectionProperty> INTERNAL_PROPERTIES =
200218
Collections.unmodifiableSet(

0 commit comments

Comments
 (0)