Hey, just a heads up... I uploaded the files (and diff log) required
for Django Oracle support. (
http://code.djangoproject.com/ticket/87)
The files are only sitting there attached to the ticket and have not
been integrated with the repository, yet. But if you're itching to try
Django on Oracle, check out the above ticket.
It isn't perfect, and it isn't unit tested, yet... but I think it's
"alpha quality" just like the other non-postgresql drivers. :-) The
main reason it isn't unit tested yet is because I'll have to modify the
unit test framework to support Oracle first, before I can test my
*other* changes! :-) Kind of a chicken-egg problem.
In the meantime, I'll keep working on the unit tests and bringing it to
parity with the postgresql driver for all features.
Issues I had to overcome to get Django to work on Oracle:
1) Sequences and auto-increment:
Oracle recommends the creation of a new sequence object for each table.
So I that's what I did. Also, I added a db trigger per table so inserts
can auto-increment the id field, just like in the other databases.
2) Nulls vs empty strings:
Oracle treats empty strings ('') exactly the same as NULLs... Some
would say this a big bug in Oracle. Anyway, I added a constant called
EMPTY_STR_EQUIV to the oracle driver and set it to a one space string
(' '), which is common practice in Oracle land. I added matching code
that will convert all empty strings to EMPTY_STR_EQUIV before database
insertion. The developer should use the EMPTY_STR_EQUIV constant when
searching fields that might have otherwise been null.
3) Offsets and limits:
Oracle doesn't have nice syntactic sugar for limiting of offsetting
result sets. The fix for this is explained in the ticket.
4) Booleans:
Oracle doesn't have a Boolean type like Postgresql. These have to be
converted to 1s and 0s before insertion into the database. This was
easy to fix using pre-database-save hooks, but this may need to changed
to a 'typecast' instead.
Django-all-the-way-ly yours,
- Jason