Skip to content

Commit 67c4076

Browse files
chore: update SQL Server samples to not require host (GoogleCloudPlatform#9157)
1 parent b213145 commit 67c4076

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

cloud-sql/sql-server/client-side-encryption/snippets/cloud_sql_connection_pool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def connect_with_pytds() -> pytds.Connection:
4545
pool = sqlalchemy.create_engine(
4646
# This allows us to use the pytds sqlalchemy dialect, but also set the
4747
# bytes_to_unicode flag to False, which is not supported by the dialect
48-
"mssql+pytds://localhost",
48+
"mssql+pytds://",
4949
creator=connect_with_pytds,
5050
)
5151

cloud-sql/sql-server/sqlalchemy/connect_connector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def getconn() -> pytds.Connection:
6363
return conn
6464

6565
pool = sqlalchemy.create_engine(
66-
"mssql+pytds://localhost",
66+
"mssql+pytds://",
6767
creator=getconn,
6868
# [START_EXCLUDE]
6969
# Pool size is the maximum number of permanent connections to keep.

cloud-sql/sql-server/sqlalchemy/connection_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,6 @@ def test_cast_vote(client: FlaskClient) -> None:
9595
def test_connector_connection(client: FlaskClient) -> None:
9696
del os.environ["INSTANCE_HOST"]
9797
app.db = app.init_connection_pool()
98-
assert str(app.db.url) == "mssql+pytds://localhost"
98+
assert str(app.db.url) == "mssql+pytds://"
9999
test_get_votes(client)
100100
test_cast_vote(client)

0 commit comments

Comments
 (0)