django on jython: using derby as a backend

62 views
Skip to first unread message

Tristan King

unread,
Jan 16, 2008, 1:17:56 AM1/16/08
to jytho...@lists.sourceforge.net, django-d...@googlegroups.com
Hi all,

I spent a bit of time today looking at using derby (http://db.apache.org/derby
) as a backend for django on jython. After spending a few hours of
digging around in code i realised i know far too little about
databases to write the backend myself.

Has anyone else considered this? I started looking into it because i
love being able to develop django apps with sqlite, but when using
jython there is no simple replacement. I thought derby would be perfect.

I'm not sure if derby is complex enough to perform the tasks that
django needs (i.e. there is no boolean data type, altho this can be
represented as an int, i dont know what effect it would have elsewhere).

anyways, i just thought i'd throw the idea out there incase anyone
else, especially anyone who has a chance at implementing it, thinks
it's a good idea.

Cheers
-Tristan

Jim Baker

unread,
Jan 16, 2008, 9:11:06 AM1/16/08
to django-d...@googlegroups.com
Tristan,

re Derby specifically, I lead the Boulder, Colorado Python Users Group (Front Range Pythoneers). Our group had a sprint in 2006 on adding Oracle backend support to Django. By combining Django (thanks Jacob!) and Oracle domain experts, we had something working that day! [It took of course another 6 months for it to be finalized and in Django trunk.] The key to getting Django ORM support with a given database backend is mapping constructs, mostly DDL, but also some DML. With respect to DML, Derby looks like it's pretty standard (SQL-92, 1999), but it doesn't have direct pagination support (through OFFSET/LIMIT) or what Oracle provides via ROWNUM. The lack of boolean specifically is not an issue; in Oracle we model this with a column that's "NUMBER(1) CHECK (%(column)s IN (0,1))" (see django.db.backends.oracle
.creation). OracleQuerySet then does the appropriate transformation via the resolve_columns method. And so forth.

Given a Derby backend, I'd like to see the following preconfigured stack available for Django on Jython (DoJ):

Derby + Tomcat + modjy + ipython

This should be something that a developer can just access via a plugin from Eclipse or Netbeans or IDE of their choice, which means they can configure Derby and Tomcat directly from the IDE. It also provides an obvious migration path to other containers and databases. Perhaps more importantly, such a setup allows for easy DoJ experimentation, whether that's for someone building a Django app, or also using tuple spaces, rules engines, PDF tools, or other parts of the heavy-lifting infrastructure available on the Java platform.

Lastly, Chris McClimans (and fellow Boulder Pythoneer) is very close to getting ipython going, and is in the process figuring out a lot of JNA <=> Jython issues that could get us "JTypes" working.

So lots of exciting developments here!

- Jim


On Jan 15, 2008 11:17 PM, Tristan King <trista...@jcu.edu.au> wrote:
Hi all,

I spent a bit of time today looking at using derby ( http://db.apache.org/derby
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jython-dev mailing list
Jytho...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-dev



--
Jim Baker
jba...@zyasoft.com
Reply all
Reply to author
Forward
0 new messages