diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2021-02-25 00:37:12 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2021-02-25 00:37:12 +0000 |
| commit | 9a5e2b04c8a3d42719690b62cb3b0e11d7cad56c (patch) | |
| tree | 8567be97dec2e32e788c7e77598146fb67ab10b9 | |
| parent | 80281c8907ac7b01b2fa377cc75cb975c9a5c3b0 (diff) | |
| parent | 2cd55d842f41d3f9f7b5dcf03c9c4a5e0a6be709 (diff) | |
| download | sqlalchemy-9a5e2b04c8a3d42719690b62cb3b0e11d7cad56c.tar.gz | |
Merge "mssql+pyodbc specify ampersand separator"
| -rw-r--r-- | lib/sqlalchemy/dialects/mssql/pyodbc.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/mssql/pyodbc.py b/lib/sqlalchemy/dialects/mssql/pyodbc.py index c94b50678..4c1e9e116 100644 --- a/lib/sqlalchemy/dialects/mssql/pyodbc.py +++ b/lib/sqlalchemy/dialects/mssql/pyodbc.py @@ -53,9 +53,18 @@ name must be URL encoded which means using plus signs for spaces:: Other keywords interpreted by the Pyodbc dialect to be passed to ``pyodbc.connect()`` in both the DSN and hostname cases include: ``odbc_autotranslate``, ``ansi``, ``unicode_results``, ``autocommit``, -``authentication`` (e.g., ``authentication=ActiveDirectoryIntegrated``). +``authentication``. Note that in order for the dialect to recognize these keywords (including the ``driver`` keyword above) they must be all lowercase. +Multiple additional keyword arguments must be separated by an +ampersand (``&``), not a semicolon: + + engine = create_engine( + "mssql+pyodbc://scott:tiger@myhost:port/databasename" + "?driver=ODBC+Driver+17+for+SQL+Server" + "&authentication=ActiveDirectoryIntegrated" + ) + Pass through exact Pyodbc string ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
