From: Mike Bayer Date: Tue, 6 Dec 2011 17:25:36 +0000 (-0500) Subject: update pyodbc/SQL server connection strings, [ticket:2217] X-Git-Tag: rel_0_7_4~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c929e70e107caa75dc6988dddb59b57b2f4eeff8;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git update pyodbc/SQL server connection strings, [ticket:2217] --- diff --git a/lib/sqlalchemy/dialects/mssql/pyodbc.py b/lib/sqlalchemy/dialects/mssql/pyodbc.py index 529cdac509..b3572b5749 100644 --- a/lib/sqlalchemy/dialects/mssql/pyodbc.py +++ b/lib/sqlalchemy/dialects/mssql/pyodbc.py @@ -35,27 +35,31 @@ Examples of pyodbc connection string URLs: dsn=mydsn;UID=user;PWD=pass;LANGUAGE=us_english -* ``mssql+pyodbc://user:pass@host/db`` - connects using a connection string - dynamically created that would appear like:: +* ``mssql+pyodbc://user:pass@host/db`` - connects using a connection + that would appear like:: DRIVER={SQL Server};Server=host;Database=db;UID=user;PWD=pass * ``mssql+pyodbc://user:pass@host:123/db`` - connects using a connection - string that is dynamically created, which also includes the port - information using the comma syntax. If your connection string - requires the port information to be passed as a ``port`` keyword - see the next example. This will create the following connection - string:: + string which includes the port + information using the comma syntax. This will create the following + connection string:: DRIVER={SQL Server};Server=host,123;Database=db;UID=user;PWD=pass * ``mssql+pyodbc://user:pass@host/db?port=123`` - connects using a connection - string that is dynamically created that includes the port + string that includes the port information as a separate ``port`` keyword. This will create the following connection string:: DRIVER={SQL Server};Server=host;Database=db;UID=user;PWD=pass;port=123 +* ``mssql+pyodbc://user:pass@host/db?driver=MyDriver`` - connects using a connection + string that includes a custom + ODBC driver name. This will create the following connection string:: + + DRIVER={MyDriver};Server=host;Database=db;UID=user;PWD=pass + If you require a connection string that is outside the options presented above, use the ``odbc_connect`` keyword to pass in a urlencoded connection string. What gets passed in will be urldecoded