Opened 19 years ago
Closed 19 years ago
#1258 closed enhancement (duplicate)
[Patch] MS-SQL backend via pymssql
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The patches are based on the work of Jakub Labath <jlabath_AT_gmail.com>. I merely helped to cut the doctest errors down to 2.
This wrapper requires pymssql. I tested with pymssql 0.7.3. A patch of pymssql is attached for boolean typecast and autocommit.
The patches tested with Django [2100]. 2 errors left:
'subclassing' module: API test failed ===================================== Code: 'a3.pub_date' Line: 66 Expected: 'datetime.date(2005, 8, 22)\n' Got: 'datetime.datetime(2005, 8, 22, 0, 0)\n' 'subclassing' module: API test failed ===================================== Code: 'a4.pub_date' Line: 86 Expected: 'datetime.date(2005, 8, 22)\n' Got: 'datetime.datetime(2005, 8, 22, 0, 0)\n' 2 errors:
The pymssql provides no hook to do custom typecasts. With the hints from this email thread, I still couldn't find a place to cast MSSQL's native datetime to date or time, if the field type is 'DateField' or 'TimeField'.
BTW: I just noticed that pymssql says it works on Windows as well. I didn't test it, but if so, it's more flexible than adodbapi then.
patch for pymssql