[go: up one dir, main page]

Skip to content

Commit

Permalink
chore(cloudsql): hide connect_args usage in basic TCP sample (#8249)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwotherspoon committed Aug 10, 2022
1 parent 1cd2422 commit 1d5caa7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cloud-sql/mysql/sqlalchemy/connect_tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def connect_tcp_socket() -> sqlalchemy.engine.base.Engine:
db_name = os.environ["DB_NAME"] # e.g. 'my-database'
db_port = os.environ["DB_PORT"] # e.g. 3306

connect_args = {}
# [END cloud_sql_mysql_sqlalchemy_connect_tcp]
connect_args = {}
# For deployments that connect directly to a Cloud SQL instance without
# using the Cloud SQL Proxy, configuring SSL certificates will ensure the
# connection is encrypted.
Expand Down Expand Up @@ -61,7 +61,9 @@ def connect_tcp_socket() -> sqlalchemy.engine.base.Engine:
port=db_port,
database=db_name,
),
# [END cloud_sql_mysql_sqlalchemy_connect_tcp]
connect_args=connect_args,
# [START cloud_sql_mysql_sqlalchemy_connect_tcp]
# [START_EXCLUDE]
# [START cloud_sql_mysql_sqlalchemy_limit]
# Pool size is the maximum number of permanent connections to keep.
Expand Down
4 changes: 3 additions & 1 deletion cloud-sql/postgres/sqlalchemy/connect_tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def connect_tcp_socket() -> sqlalchemy.engine.base.Engine:
db_name = os.environ["DB_NAME"] # e.g. 'my-database'
db_port = os.environ["DB_PORT"] # e.g. 5432

connect_args = {}
# [END cloud_sql_postgres_sqlalchemy_connect_tcp]
connect_args = {}
# For deployments that connect directly to a Cloud SQL instance without
# using the Cloud SQL Proxy, configuring SSL certificates will ensure the
# connection is encrypted.
Expand All @@ -61,7 +61,9 @@ def connect_tcp_socket() -> sqlalchemy.engine.base.Engine:
port=db_port,
database=db_name,
),
# [END cloud_sql_postgres_sqlalchemy_connect_tcp]
connect_args=connect_args,
# [START cloud_sql_postgres_sqlalchemy_connect_tcp]
# [START_EXCLUDE]
# [START cloud_sql_postgres_sqlalchemy_limit]
# Pool size is the maximum number of permanent connections to keep.
Expand Down

0 comments on commit 1d5caa7

Please sign in to comment.