ANN: Alpha release of new MS SQL Server backend

4 views
Skip to first unread message

mamcx

unread,
Aug 2, 2007, 9:22:07 PM8/2/07
to Django developers
I submit a ticket with patchs for enable a new backend, so we can have
a clean direction from the ado_mssql confusion of tickets.

Is at http://code.djangoproject.com/ticket/5062.

I run my own test and the standar django ones (however I'm very
intrigated by the fact I found only 2 problems here... I simply do
runtest --settings settings as usual).

I hope tomorrow see how hard is emulate the LIMIT thing based in the
code of oracle backend.

Jacob Kaplan-Moss

unread,
Aug 3, 2007, 12:00:29 PM8/3/07
to django-d...@googlegroups.com
Hey Mamcx --

On 8/2/07, mamcx <mam...@gmail.com> wrote:
> I submit a ticket with patchs for enable a new backend, so we can have
> a clean direction from the ado_mssql confusion of tickets.

Lookin' good -- keep up the good work!

I know you're very much in the early stages of this, so I'll hold off
on any serious feedback until you've progressed a bit further.

However, I did want to suggest that you submit your pymssql patches to
the upstream maintainer. We can't accept code into Django that'll
depend on patched versions of upstream code, so you'll need to get the
pymssql folks to accept your bugfixes (or figure out how to work
around the bugs).

Jacob

mamcx

unread,
Aug 3, 2007, 3:25:44 PM8/3/07
to Django developers
Yes...

I'm waitting to see if the actual pathc for pymssql is enough or still
need more work for do a single submit...

pk11

unread,
Aug 3, 2007, 5:03:52 PM8/3/07
to Django developers
hey all,

we are also using django with pymssql/mssql, in addition to your work,
we changed:
- django's admin log model object_id's type is changed from text to
integer (is there a reason why object_id is declared as textfield?)
- pymssql is changed to allow unicode strings
- simulate limit with TOP
- mysql throws an error because it can handle only 23:59:59.99 but
not 23:59:59.999999, please see: django/db/models/fields/__init__.py
at 222 line

let me know if you guys want to work together.

cheers,
peter

mamcx

unread,
Aug 3, 2007, 6:34:22 PM8/3/07
to Django developers
Excelent. Please send me your patch so I take a look at it.

I finish today a implementation of LIMIT so I'm interested in how you
solve it.

Jeremy Dunck

unread,
Aug 3, 2007, 9:02:55 PM8/3/07
to django-d...@googlegroups.com
On 8/3/07, pk11 <peter....@gmail.com> wrote:
> - django's admin log model object_id's type is changed from text to
> integer (is there a reason why object_id is declared as textfield?)

object_id is whatever the arbitrary model's PK is, and you can't
assume it's an integer in the general case. The model's PK is
serialized to text.

> - mysql throws an error because it can handle only 23:59:59.99 but
> not 23:59:59.999999, please see: django/db/models/fields/__init__.py
> at 222 line

mysql or mssql?

pk11

unread,
Aug 3, 2007, 9:28:22 PM8/3/07
to Django developers
Hi Jeremy, thanks for the info,

I meant mssql, sorry.

the issue with object_id is that mssql can not insert an integer PK
into a TEXT field.

so how should it be handled then if the field type can not be changed?

peter

On Aug 3, 9:02 pm, "Jeremy Dunck" <jdu...@gmail.com> wrote:

pk11

unread,
Aug 3, 2007, 9:37:54 PM8/3/07
to Django developers
hey, i will be able to send you my patch on monday.

the generic idea is to attach LIMIT as if the backend supported it and
at query execution time replace it with TOP.

OFFSET can be handled by nested queries but i did not have enough time
to finish that.
(i.e.
http://groups.google.com/group/django-developers/browse_thread/thread/7ad0d5f5e3a76c40/89a6eb0e2ad64f6d?lnk=gst&q=mssql&rnum=2&hl=en#89a6eb0e2ad64f6d)

cheers, peter

Jeremy Dunck

unread,
Aug 4, 2007, 9:21:53 AM8/4/07
to django-d...@googlegroups.com
On 8/3/07, pk11 <peter....@gmail.com> wrote:
> the issue with object_id is that mssql can not insert an integer PK
> into a TEXT field.
>

I guess I'm confused. Admin LogEntryManager forces object_id to a
string before saving. Do you see somewhere that's directly filling
LogEntry.object_id with an integer?

pk11

unread,
Aug 6, 2007, 2:36:32 PM8/6/07
to Django developers
mamcx, I sent you my mods.

Jeremy,

I tested the admin + pymssql backend again without my modification
(i.e. changing object_id's type), and now seems to be working just
fine. do not really know what was causing the issue before though.
anyway, thanks for the information.

Peter


On Aug 4, 9:21 am, "Jeremy Dunck" <jdu...@gmail.com> wrote:

pk11

unread,
Aug 6, 2007, 2:39:14 PM8/6/07
to Django developers
hey, sorry, forgot one thing:
in django/db/models/fields
222 # mssql can not handle more than two 99-s
223 return ['%s-01-01 00:00:00' % value, '%s-12-31
23:59:59.99' % value]


On Aug 3, 6:34 pm, mamcx <mamc...@gmail.com> wrote:

mamcx

unread,
Aug 6, 2007, 4:25:15 PM8/6/07
to Django developers
Thanks for the info.

I test it and tommorrow in the next 2 days do another release...

Reply all
Reply to author
Forward
0 new messages