Creating database structures in a portable way

Samuel knipknap at gmail.com
Mon Sep 18 13:56:42 EDT 2006


> FWIW, there's a Python port of adodb:
> http://phplens.com/lens/adodb/adodb-py-docs.htm
>
> and parsing XML in Python is quite easy. So you could as well port the
> AdoDB XML to Python too.

That is exactly what I am trying to avoid. While implementing the
parser might be easy, you have to translate things into different
database flavors, caring about a bunch of things that I'd rather not
have to think about.

> OTOH, there are other - possibly better (YMMV) - DB abstraction layers
> in Python, like SQLAlchemy.

SQLAlchemy looks pretty good, but unfortunately apparently requires
shell access for installation (or at least, I have not found any other
solution covered in the docs), which I can not use. I need a solution
that can be shipped in a software package, and installed by simply
copying it to the server.

> And since the above solution requires
> (re)writing the xml-parsing part, it might be worth rewriting it so it
> knows how to generate SQLAlchemy schemas instead.

Rewriting the schema is possible (I only want to keep it separated from
the code), so using SQLAlchemy's built in solution for generating
tables seems just fine. It's only the installation part.

Anyway, I am wondering; Python seems to include database adapters for
almost any important database, all with a unified API. Why would you
need another database abstraction on top of that?

Thanks,
-Samuel




More information about the Python-list mailing list