Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies = [
"langchain==0.1.1",
"SQLAlchemy==2.0.7",
"sqlalchemy-pytds==0.3.5",
"cloud-sql-python-connector[pytds]==1.5.0"
"cloud-sql-python-connector[pytds]==1.7.0"
]

[tool.setuptools.dynamic]
Expand Down
6 changes: 5 additions & 1 deletion src/langchain_google_cloud_sql_mssql/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
import sqlalchemy
from google.cloud.sql.connector import Connector

from .version import __version__

USER_AGENT = "langchain-google-cloud-sql-mssql-python/" + __version__


class MSSQLEngine:
"""A class for managing connections to a Cloud SQL for MSSQL database."""
Expand Down Expand Up @@ -92,7 +96,7 @@ def _create_connector_engine(
Python Connector.
"""
if cls._connector is None:
cls._connector = Connector()
cls._connector = Connector(user_agent=USER_AGENT)

# anonymous function to be used for SQLAlchemy 'creator' argument
def getconn():
Expand Down