Skip to content

Commit 1d5caa7

Browse files
chore(cloudsql): hide connect_args usage in basic TCP sample (GoogleCloudPlatform#8249)
1 parent 1cd2422 commit 1d5caa7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cloud-sql/mysql/sqlalchemy/connect_tcp.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def connect_tcp_socket() -> sqlalchemy.engine.base.Engine:
3232
db_name = os.environ["DB_NAME"] # e.g. 'my-database'
3333
db_port = os.environ["DB_PORT"] # e.g. 3306
3434

35-
connect_args = {}
3635
# [END cloud_sql_mysql_sqlalchemy_connect_tcp]
36+
connect_args = {}
3737
# For deployments that connect directly to a Cloud SQL instance without
3838
# using the Cloud SQL Proxy, configuring SSL certificates will ensure the
3939
# connection is encrypted.
@@ -61,7 +61,9 @@ def connect_tcp_socket() -> sqlalchemy.engine.base.Engine:
6161
port=db_port,
6262
database=db_name,
6363
),
64+
# [END cloud_sql_mysql_sqlalchemy_connect_tcp]
6465
connect_args=connect_args,
66+
# [START cloud_sql_mysql_sqlalchemy_connect_tcp]
6567
# [START_EXCLUDE]
6668
# [START cloud_sql_mysql_sqlalchemy_limit]
6769
# Pool size is the maximum number of permanent connections to keep.

cloud-sql/postgres/sqlalchemy/connect_tcp.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ def connect_tcp_socket() -> sqlalchemy.engine.base.Engine:
3333
db_name = os.environ["DB_NAME"] # e.g. 'my-database'
3434
db_port = os.environ["DB_PORT"] # e.g. 5432
3535

36-
connect_args = {}
3736
# [END cloud_sql_postgres_sqlalchemy_connect_tcp]
37+
connect_args = {}
3838
# For deployments that connect directly to a Cloud SQL instance without
3939
# using the Cloud SQL Proxy, configuring SSL certificates will ensure the
4040
# connection is encrypted.
@@ -61,7 +61,9 @@ def connect_tcp_socket() -> sqlalchemy.engine.base.Engine:
6161
port=db_port,
6262
database=db_name,
6363
),
64+
# [END cloud_sql_postgres_sqlalchemy_connect_tcp]
6465
connect_args=connect_args,
66+
# [START cloud_sql_postgres_sqlalchemy_connect_tcp]
6567
# [START_EXCLUDE]
6668
# [START cloud_sql_postgres_sqlalchemy_limit]
6769
# Pool size is the maximum number of permanent connections to keep.

0 commit comments

Comments
 (0)