]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
mssql+pyodbc specify ampersand separator
authorGord Thompson <gord@gordthompson.com>
Wed, 24 Feb 2021 15:51:55 +0000 (08:51 -0700)
committerGord Thompson <gord@gordthompson.com>
Wed, 24 Feb 2021 15:51:55 +0000 (08:51 -0700)
Specify that ampersand (not semicolon) must be used to separate
additional keyword arguments in hostname connections.

Change-Id: Id5b3276e6da8d42f5384e3cc4f5272f6e20aa61c

lib/sqlalchemy/dialects/mssql/pyodbc.py

index c94b50678871c601f97ce7833b33613984554f21..4c1e9e1160c9bcd0eadb28fdf3665fe5f1c9a228 100644 (file)
@@ -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
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^