Skip to content

Commit

Permalink
add timeout parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebruyn committed May 21, 2023
1 parent b5ac6c1 commit 5b94291
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dbt/adapters/sqlserver/sql_server_connection_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,9 @@ def connect():
con_str_concat,
attrs_before=attrs_before,
autocommit=True,
timeout=credentials.login_timeout,
)
handle.timeout = credentials.query_timeout
logger.debug(f"Connected to db: {credentials.database}")
return handle

Expand Down
4 changes: 4 additions & 0 deletions dbt/adapters/sqlserver/sql_server_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class SQLServerCredentials(Credentials):
trust_cert: Optional[bool] = False # default value in MS ODBC Driver 18 as well
retries: int = 1
schema_authorization: Optional[str] = None
login_timeout: Optional[int] = None
query_timeout: Optional[int] = None

_ALIASES = {
"user": "UID",
Expand Down Expand Up @@ -58,6 +60,8 @@ def _connection_keys(self):
"encrypt",
"trust_cert",
"retries",
"login_timeout",
"query_timeout",
)

@property
Expand Down

0 comments on commit 5b94291

Please sign in to comment.