[DB-SIG] Table Oriented Programming
Michael Hobbs
michael at hobbshouse.org
Mon Jan 31 21:17:25 CET 2005
Brad Clements said:
> On 12 Feb 2004 at 13:10, Michael Hobbs wrote:
>
>> Consider this example code:
>> departments = DepartmentTable
>> employees = EmployeeTable
>> johnsDepartment = (departments * employees) /
>> (employees.dept == departments.dept) /
>> (employees.name == 'John') %
>> departments.name
>> print johnsDepartment[0].name
>
> Has anyone tried expressing sql operations as relational algebra
> statements in Python,
> like the example above.
I had worked on a prototype for this a long time ago, before I got bored
with the problem. ;-) I believe that it is completely undocumented, in a
very raw state, and problably written in bad newbie Python, but if no one
objects, I can post it as an attachment to this mail-list.
I took a look at the sqlbuilder code from SQLObject, mentioned in a
previous post, but that is still rather SQL-like and not very Relational
Algebra-like. (For example, it uses words such as "select" and "where"
instead of "project" and "select".)
Let me know,
- Mike
More information about the DB-SIG
mailing list