[ZODB-Dev] AdaptableStorage and ZClass instances

Roché Compaan roche@upfrontsystems.co.za
Thu, 13 Feb 2003 22:21:02 +0200


> I've been wondering if it would be possible to blend AdaptableStorage 
> and "Modeling":
> 
> http://modeling.sourceforge.net/

Don't know this but will have a look.

> >Jean and Roché at Upfront had some interesting ideas on how to go about 
> >'templating' SQL to make this possible, perhaps they could comment?
> 
> All the relevant code is in the "gateway_sql" subpackage.  We can 
> refactor mercilessly, since the tests have decent coverage.

On first impresssion it doesn't seem to be that hard to take what is
there and only override it where necessary for use on another RDBMS.
This is after a quick scan and relative to the amount of work I expected
it to be.

I think object relational mappings are very implementation specific so I
don't expect the mapper to do all the magic. AdaptableStorage can help
do the 70% of work that is common in all implemenations.

What I think will work much better and really improve queryability of
data is if one uses a table per class map. One shouldn't require a
gateway per class however - that's to much work ;-) A single gateway
can generate sql for most classes based simply on class properties.
What will help here is if one has typemap per RDBMS, mapping python
datatypes to the RDBMS' datatypes. For more complex types one will need
specialised gateways but that is to be expected.

If this idea have appeal - I have some code that inspects class schema
and generates sql from it. I'll see if I can make some time this weekend
to make it work with AS.

-- 
Roché Compaan
Upfront Systems                 http://www.upfrontsystems.co.za