Ian wrote:

>>I wanted something that wrapped a normal database, not a database that
wrapped normal Python objects.<<

This is what I'm looking for too. I'm getting postings out of sequence,
missing posts, etc. so I'm just guessing that Stephen was looking at some
code you sent him?

I'm screwing around with the problem of a minimal OR mapper right now too.
I've taken a very close look at dbObj, PyDO, dTuple, SQLDict, MiddleKit,
etc. and none of them seem to satisfy a few basic needs, apart from the one
you mentioned. What I need is:

1. Something that works with multiple pools of database connections, each
pool potentially coming from a completely different source (Oracle,
PostgreSQL, etc.)

2. Support for transactions

3. Can wrap existing schema (allow the full richness of joins, etc.)

4. Can be bypassed if needed

5. Can support a central query dispatch mechanism (so that the overlying
code doesn't have to know about special syntax, schema, etc. of the
underlying RDBMS). A query is silently translated into a native
representation, probably using memoized lookup tables.

So far, I've got 1, 2, 4, and 5 going, but I'm still trying to find a
decent way to (lightly) "objectify" the RDBMS. By this, I mean make it less
onerous to manipulate in Python.

My last experiment to day was to throw together some code to make tables
become objects that understood update, select, insert, etc. messages. E.g.:

# Make table accessor object for table user_table, using connection pool
'oracle'
x = DBTable('user_table', 'oracle')

# Return all columns, all rows
x.select()

# Return just col_one and col_two of a certain subset:
x.columnList = ['col_one', 'col_two']
x.select(where="id=1 and name='apple'")

# Insert a row
x.insert(name='test', id=34)

etc...

But, this approach doesn't work well for joins, which are important in an
RDBMS.

The only two ORMs I've seen that support joins are PyDO and dbObj. The
latter is too MySQL oriented. The former does support Oracle, PostgreSQL
and MySQL. I'm still mulling over whether PyDO can be hacked to use my
multiple pooling hack.

...Edmund.



_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to