Re: [Sqlalchemy-tickets] [sqlalchemy] #2795: Add pypyodbc support
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2014-01-12 01:25:12
|
#2795: Add pypyodbc support
------------------------------+----------------------------------
Reporter: sontek | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.x.xx
Component: mssql | Severity: minor - half an hour
Resolution: | Keywords:
Progress State: in queue |
------------------------------+----------------------------------
Comment (by zzzeek):
OK I've gotten some pypyodbc tests to run, will need its own
connector/dialect with some different options and different way of
detecting server version info. pypyodbc isn't working for me with pypy at
the moment but is working with cpython.
here's the flags i need to have detected differently when its in use:
{{{
#!diff
diff --git a/lib/sqlalchemy/connectors/pyodbc.py
b/lib/sqlalchemy/connectors/pyodbc.py
index 284de28..b920516 100644
--- a/lib/sqlalchemy/connectors/pyodbc.py
+++ b/lib/sqlalchemy/connectors/pyodbc.py
@@ -47,7 +47,7 @@ class PyODBCConnector(Connector):
@classmethod
def dbapi(cls):
- return __import__('pyodbc')
+ return __import__('pypyodbc')
def create_connect_args(self, url):
opts = url.translate_connect_args(username='user')
@@ -138,6 +138,7 @@ class PyODBCConnector(Connector):
else:
self.supports_unicode_binds = True
+ self.supports_unicode_binds = False
# run other initialization which asks for user name, etc.
super(PyODBCConnector, self).initialize(connection)
diff --git a/lib/sqlalchemy/dialects/mssql/base.py
b/lib/sqlalchemy/dialects/mssql/base.py
index 90fd1f3..d5fa15d 100644
--- a/lib/sqlalchemy/dialects/mssql/base.py
+++ b/lib/sqlalchemy/dialects/mssql/base.py
@@ -1127,6 +1127,7 @@ class MSDialect(default.DefaultDialect):
def initialize(self, connection):
super(MSDialect, self).initialize(connection)
+ self.server_version_info = MS_2008_VERSION
if self.server_version_info[0] not in list(range(8, 17)):
# FreeTDS with version 4.2 seems to report here
# a number like "95.10.255". Don't know what
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2795#comment:7>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|