Skip to content

fix(cloud-sql): Updated sample to include full JDBC url in comments.#3562

Merged
lesv merged 3 commits into
GoogleCloudPlatform:masterfrom
shubha-rajan:add-full-jdbc-url
Aug 19, 2020
Merged

fix(cloud-sql): Updated sample to include full JDBC url in comments.#3562
lesv merged 3 commits into
GoogleCloudPlatform:masterfrom
shubha-rajan:add-full-jdbc-url

Conversation

@shubha-rajan
Copy link
Copy Markdown
Contributor

Fixes internal bug b/165099138.

@shubha-rajan shubha-rajan requested review from a team and kurtisvg August 18, 2020 20:35
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 18, 2020

// Configure which instance and what database user to connect with.
// Equivalent URL:
// jdbc:mysql:///<DATABASE_NAME>?cloudSqlInstance=<INSTANCE_CONNECTION_NAME>&socketFactory=com.google.cloud.sql.mysql.SocketFactory&user=<MYSQL_USER_NAME>&password=<MYSQL_USER_PASSWORD>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a long line, and doesn't actually represent what you have below.


// Configure which instance and what database user to connect with.
// Equivalent URL:
// jdbc:postgresql:///<DATABASE_NAME>?cloudSqlInstance=<INSTANCE_CONNECTION_NAME>&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=<POSTGRESQL_USER_NAME>&password=<POSTGRESQL_USER_PASSWORD>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Copy Markdown
Contributor

@lesv lesv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you can explain how to use that line and break it up.

@shubha-rajan
Copy link
Copy Markdown
Contributor Author

I moved the URL to after the data source property for socket factory was set. It's still really long though. The issue is that we're constructing that URL step by step, but I'm not sure if users realize that the partial URL we have in the sample is for connections that use the socket factory.

@shubha-rajan shubha-rajan requested a review from lesv August 18, 2020 21:17
@kurtisvg
Copy link
Copy Markdown
Contributor

I would actually prefer the line to be above. The reason I asked for this change was because someone didn't read the code and tried to copy L54 without the additional parameters, and filed feedback when it didn't work. I wanted to give a sneak peak of the full JDBC url in advance for the inpatient folks.

I'm also okay if we opt to just link to this section of the README for the full JDBC configurations: https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory#creating-the-jdbc-url

As long as it's next to the base url I'm happy.

@lesv
Copy link
Copy Markdown
Contributor

lesv commented Aug 18, 2020

I'll leave it to your judgement.

@shubha-rajan
Copy link
Copy Markdown
Contributor Author

@kurtisvg moved it back to before the base URL. I'll merge after you approve

@lesv lesv merged commit b594c48 into GoogleCloudPlatform:master Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants