Jython and sqlalchemy

7 views
Skip to first unread message

fwier...@gmail.com

unread,
Jul 16, 2007, 11:19:21 PM7/16/07
to sqlalchemy
Hi all,

My name is Frank Wierzbicki and I'm the primary maintainer of Jython.
We are about to release 2.2, so I've turned my attention to post 2.2
stuff. I tried our 2.3 alpha with sqlalchemy against mysql and found
that it wasn't that hard to get it to work for a (very) simple test.
This is by no means complete or even good, but I am keeping the code
here: http://jython.svn.sourceforge.net/svnroot/jython/trunk/sandbox/wierzbicki/sqlalchemy/

The three files are a simple test (sqla.py), a monkey-patched version
of database/mysql.py (mysql.py) and the "svn diff" as of today
(mysql.diff) so I can keep track of the changes I made to get things
to work. mysql.py can be pasted on top of the real one, then you can
run jython (latest from the 2.3 branch) and it works, at least on my
machine :)

Obviously patching mysql.py might not be the way it should really be
designed and this was just enough change to get my simple test to
work, but I thought I would share and see what people think about
getting sqlalchemy to work from Jython.

-Frank

Michael Bayer

unread,
Jul 16, 2007, 11:40:48 PM7/16/07
to sqlal...@googlegroups.com
hey frank -

awesome ! i had tried Jython a little bit but had probs getting its
2.3 support happening. glad to hear its able to import sqlalchemy.

this does raise an issue which has come up a few times, which is the
best strategy to break up our dialects to support a common database
among different drivers. We do have an ad-hoc approach to this in
mssql.py and its been suggested that we might want to break up the
system to support things like mxODBC. I think the approach we take
would wind up having urls like "jdbc:mysql://<url>" and such,
breaking up dialects to be two distinct levels.

anyway, we've had our eye on someday having Jython working with SA
all the way since the beginning, so whatever I can do to help let me
know, or stop by on #sqlalchemy on freenode.

- mike

Frank Wierzbicki

unread,
Jul 17, 2007, 7:35:22 AM7/17/07
to sqlal...@googlegroups.com
On 7/16/07, Michael Bayer <mik...@zzzcomputing.com> wrote:
>
> hey frank -
>
> awesome ! i had tried Jython a little bit but had probs getting its
> 2.3 support happening. glad to hear its able to import sqlalchemy.
It certainly continues to have some problems, for example, I think
"re" is missing a few methods -- so my hacked up mysql.py switched to
sre. That's a bug in Jython that will need to get looked at. Worse
than that, we don't support decorators yet, so we won't be able to run
sqlalchemy's unit tests until we straighten that out (btw calling the
branch "2.3" is outdated now -- we will probably target Python 2.5 for
the next Jython version).

> this does raise an issue which has come up a few times, which is the
> best strategy to break up our dialects to support a common database
> among different drivers. We do have an ad-hoc approach to this in
> mssql.py and its been suggested that we might want to break up the
> system to support things like mxODBC. I think the approach we take
> would wind up having urls like "jdbc:mysql://<url>" and such,
> breaking up dialects to be two distinct levels.

That sounds reasonable -- that was a question I had in mind when I
posted this, glad to hear that you are thinking about it.
jdbc:mysql:// will look very natural to Java developers.

> anyway, we've had our eye on someday having Jython working with SA
> all the way since the beginning, so whatever I can do to help let me
> know, or stop by on #sqlalchemy on freenode.

Glad to hear it!

-Frank

Reply all
Reply to author
Forward
0 new messages