Python databases

jdavidb on 2003-01-23T19:46:57

Not long ago, I posted a list of DBD modules that do not require you to have a separate RDBMS. Today I note Python moving in a similar direction, including doing some work with SQLite. Interesting that as folks here keep saying they'd like to see more done with SQLite (Slash on SQLite! Bundle it with Perl and Perl will include a complete database! etc., etc.), Python folks are noticing the same need.

For some time now, I've been saying I'd like to implement a complete RDBMS in Perl. My coworkers always said I was crazy, and I agreed. But I did have a copy of Fundamentals of Database Systems, recommended reading for PostgreSQL hackers [not people who write apps with PostgreSQL ... people who write PostgreSQL], written by a professor from my university from whom I am taking a graduate databases class this semester. The idea seemed quite possible, although I wouldn't expect it to have the greatest efficiency. Now this article comes out and it turns out somebody has already done this in Python, and it's called Gadfly. Anyone want to step up to the plate for Perl? I threw together a simple Table.pm awhile back that handled single-field indexes and single-table selects. Fun work. :)


Strange you should ask ...

autarch on 2003-01-23T21:40:29

I've been thinking about implementing a _real_ RDBMS in Perl for a while. By real, I mean really relational, as opposed to the godawful crap we see today. This means no SQL, except via a portability layer.

A good reference for what this would look like is CJ Date & Hugh Darwen's "Third Manifest" book. I don't like the syntax of their Tutorial D language, but that's not a big deal, since they themselves say that their syntax is just one possible implementation of a "valid D" language.

OTOH

autarch on 2003-01-23T21:42:08

If you were very wedded to the SQL DBMS "model" (it's not a model, it's a mess), you should check out the Alzabo code. There's a lot of code in there that could be really useful in implementing a SQL DBMS in Perl.

Why not start from SQLite

mir on 2003-01-23T23:40:42

I haven't really looked at the source code for SQLite, but would it be possible to re-implement it in Perl? The doc states explicitely that "Sources are in the public domain. Use for any purpose."