- added optional __table_opts__ dictionary to ActiveMapper, will send kw options to
Table objects [ticket:462]
- mssql:
+ - preliminary support for pyodbc (Yay!) [ticket:419]
- better support for NVARCHAR types added [ticket:298]
- fix for commit logic on pymssql
- fix for query.get() with schema [ticket:456]
- fix for non-integer relationships [ticket:473]
- DB-API module now selectable at run-time [ticket:419]
- - preliminary support for pyodbc (Yay!) [ticket:419]
- now passes many more unit tests [tickets:422, 481, 415]
- better unittest compatibility with ANSI functions [ticket:479]
- improved support for implicit sequence PK columns with auto-insert [ticket:415]
- fix for blank password in adodbapi [ticket:371]
- fixes to get unit tests working with pyodbc [ticket:481]
+ - fix to auto_identity_insert on db-url query
+ - added query_timeout to db-url query parms. currently works only for pymssql
+ - tested with pymssql 0.8.0 (which is now LGPL)
0.3.4
"""
notes:
- supports both pymssql and adodbapi interfaces
+ supports the pymssq, adodbapi and pyodbc interfaces
IDENTITY columns are supported by using SA schema.Sequence() objects. In other words:
Table('test', mss_engine,
no support for more than one IDENTITY column per table
no support for table reflection of IDENTITY columns with (seed,increment) values other than (1,1)
no support for GUID type columns (yet)
- pymssql has problems with transaction control that this module attempts to work around
pymssql has problems with binary and unicode data that this module does NOT work around
adodbapi fails testtypes.py unit test on unicode data too -- issue with the test?
sane_rowcount = False
dialect = MSSQLDialect
import warnings
- warnings.warn('pyodbc support in sqlalchemy.databases.mssql is extremely experimental - use at your own risk.')
+ warnings.warn('pyodbc support in sqlalchemy.databases.mssql is experimental - use at your own risk.')
colspecs[sqltypes.Unicode] = AdoMSUnicode
ischema_names['nvarchar'] = AdoMSUnicode
opts = url.translate_connect_args(['host', 'database', 'user', 'password', 'port'])
opts.update(url.query)
if opts.has_key('auto_identity_insert'):
- self.auto_identity_insert = bool(int(opts['auto_identity_insert']))
+ self.auto_identity_insert = bool(opts.pop('auto_identity_insert'))
+ if opts.has_key('query_timeout'):
+ self.query_timeout = int(opts.pop('query_timeout'))
return make_connect_string(opts)
def create_execution_context(self):
connection.rollback()
except:
pass
+
+ def create_connect_args(self, url):
+ r = super(PyMSSQLDialect, self).create_connect_args(url)
+ if hasattr(self, 'query_timeout'):
+ dbmodule._mssql.set_query_timeout(self.query_timeout)
+ return r
+
+
## This code is leftover from the initial implementation, for reference
## def do_begin(self, connection):
## """implementations might want to put logic here for turning autocommit on/off, etc."""