diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-12-06 12:25:36 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-12-06 12:25:36 -0500 |
commit | c929e70e107caa75dc6988dddb59b57b2f4eeff8 (patch) | |
tree | ed765495a22c529b075bcf4887dedfaebaff9c29 /lib/sqlalchemy | |
parent | e63117159f2c5c52cdefec9a79457b799ab1c08a (diff) | |
download | sqlalchemy-c929e70e107caa75dc6988dddb59b57b2f4eeff8.tar.gz |
update pyodbc/SQL server connection strings, [ticket:2217]
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r-- | lib/sqlalchemy/dialects/mssql/pyodbc.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/sqlalchemy/dialects/mssql/pyodbc.py b/lib/sqlalchemy/dialects/mssql/pyodbc.py index 529cdac50..b3572b574 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 |