Proboscis as Portable Driver

James William Pye pgsql at jwp.name
Fri May 5 05:04:15 UTC 2006


Firstly, sorry for the late reply. That weekend, I was upgrading my box.
(dual-core amd64 :). Subsequently, this letter must have gotten lost in that
traversal. In addition to simply being down most of the weekend, I started up a
misconfigured mail server(well, missing procmail, but that's all it takes).
=\

> Though, I'm not a Java developer, I've long been impressed by the
> portability of pure Java database drivers and wanted this in Python even
> at a moderate performance penalty.  I started work on my own before I
> ran across PostgresPy and specifically Proboscis.

> In the goals section
> of the docs, it mentions a DB-API 2.0 interface and I was thrilled when
> I saw dbapi2.py in cvs.

Yeah, doing the DB-API 2.0 interface was actually quite trivial. I figured it
would make those who like the interface happy. Sadly, tho, it currently does a
terrible job with '?' parameters; I would have just used Postgres' $x params,
but DB-API does not cover those. For simple use, tho, it should be ok.
(hint, if you ever get bored, there's still some improvements to be made here.
Primarily, it just needs to understand PostgreSQL's quoting conventions, so that
it doesn't overwrite quoted question marks. ;)

> So now I'm wondering how difficult would it be to provide a portable
> driver using Proboscis.  By portable, I mean you can include the driver
> with your application so that there are no external requirements other
> than the Python interpreter and standard library.  Maybe a Python egg?

> I'm going along to play with dbapi2.py and eggs.

Certainly. The PostgresPy package that I recently put up in the download
section would be a great starting place. Just remove all the extension module
information that it collects, and use setuptools instead of distutils. For the
driver alone, you'll need 'lo', 'ex', 'pq', 'typ', and 'fe', so you can strip
out the references to the other packages. From there, I think you're a bdist
command away from having an egg. ;)

> Thanks for the great software.

=)


More information about the Python-general mailing list