mssql through pyodbc (and unixODBC and FreeTDS on debian) connections
are broken for me when I pass a url to create engine. I can see that
databases/mssql.py:make_connect_string has been changed to express
host and port as ''server=<host>,<port>" from
"server=<host>;port=<port>" when the driver attribute is 'SQL Server'.
It seems that this change was made to address ticket 1192[0].

It seems that the way that the port should be expressed in the
connection string is more related to the underlying driver
implementation and not its name. As I mentioned above, we're using
FreeTDS with unixODBC. The FreeTDS documentation on connection strings
[1] indicates that the port specification is not a special case and
that it should be specified int the 'key=value format. If, on my dev
box, I change my /etc/odbcinst.ini entry from [SQL Server] to
[FreeTDS] and I specify driver=FreeTDS (per the MSSQL section of the
SA Database Notes[2]), then my connection seems to work.

So clearly, for my configuration, the driver name is configurable and
it doesn't actually say anything about the driver it names. Is the
driver name on windows configurable? I'm guessing that it is not.
Regardless, I think that making decisions based on the driver name is
probably not a good idea.

Maybe the way to handle this is to introduce another connect argument
for pyodbc, but I'm not sure that this should look like. Maybe
'port_style', with possible values of 'windows', 'freetds', and
whatever else people are using? Or maybe the values are 'comma' and
'attribute', or something. I'm terrible at naming things, so somebody
please step in here. If we can get the names resolved, I'll be glad to
put together a patch.

[0] http://www.sqlalchemy.org/trac/ticket/1192
[1] http://www.freetds.org/userguide/odbcconnattr.htm
[2] http://www.sqlalchemy.org/trac/wiki/DatabaseNotes
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to