Skip to content

Commit 329d9ca

Browse files
committed
chore(cloud-sql): cleanup pg/knex example comments
Just cleaning up a couple of the sample comments to make sure it propertly mentions the `INSTANCE_CONNECTION_NAME` environment variable name and uses an IAM username in examples that is similar to the usernames used by Posgtres Cloud SQL Instances. Ref: GoogleCloudPlatform#3266
1 parent c829630 commit 329d9ca

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

cloud-sql/postgres/knex/connect-connector-with-iam-authn.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const connectWithConnectorAutoIAMAuthn = async config => {
4242
client: 'pg',
4343
connection: {
4444
...clientOpts,
45-
user: process.env.IAM_DB_USER, // e.g. 'service-account-name'
45+
user: process.env.IAM_DB_USER, // e.g. 'sa-name@project-id.iam'
4646
database: process.env.DB_NAME, // e.g. 'my-database'
4747
},
4848
// ... Specify additional properties here.

cloud-sql/postgres/knex/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ const createPool = async () => {
119119
}
120120
}
121121
if (process.env.INSTANCE_CONNECTION_NAME) {
122-
// Uses the Cloud SQL Node.js Connector (e.g., project:region:instance) is defined
122+
// Uses the Cloud SQL Node.js Connector when INSTANCE_CONNECTION_NAME
123+
// (e.g., project:region:instance) is defined
123124
return createConnectorPool(config);
124125
} else if (process.env.INSTANCE_HOST) {
125126
// Use a TCP socket when INSTANCE_HOST (e.g., 127.0.0.1) is defined

0 commit comments

Comments
 (0)