diff --git a/setup.py b/setup.py index 4860777..e142ff8 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name="tds-django", - version="4.2.0", + version="4.2.1", author="Etienne Cogels", author_email="ecogels@users.noreply.github.com", description="Django backend for SQL Server using tds", diff --git a/tds_django/base.py b/tds_django/base.py index 91e7d60..1727b0b 100644 --- a/tds_django/base.py +++ b/tds_django/base.py @@ -101,6 +101,10 @@ class DatabaseWrapper(BaseDatabaseWrapper): def get_connection_params(self): settings_dict = self.settings_dict # TODO warnings for user + # skipped: as_dict use_tz bytes_to_unicode row_strategy server(?) + allowed_params = 'timeout login_timeout appname tds_version use_mars auth readonly load_balancer ' \ + 'failover_partner cafile sock validate_host enc_login_only disable_connect_retry ' \ + 'pooling use_sso'.split() conn_params = { 'dsn': settings_dict['HOST'] or 'localhost', 'port': settings_dict['PORT'] or 1433, @@ -108,7 +112,7 @@ def get_connection_params(self): 'user': settings_dict['USER'], 'password': settings_dict['PASSWORD'], 'autocommit': getattr(settings, 'AUTOCOMMIT', False), - 'use_mars': False, + **{k: v for k, v in settings_dict.items() if k in allowed_params}, } return conn_params