Hope it's not to late :-) I was thinking for quite a while doing a object
relational wrapper. For me it should work on Mysql and eventually Oracle.
I've already some ideas, but nothing written yet. Maybe we should exchange
some ideas. If you think that could be a good idea, just shout :-)
> Chuck Esterbrook <ChuckEsterbrook@...>:
> > > I don't think I'd need it for my application. (And, btw, Postgres
> > > supports array columns, so I could even store lists directly...
> > > Though putting them in a separate table wouldn't be that hard, I
> > > think. Again, naming conventions could help out.)
> > Okay, so you're not necessarily supporting legacy databases (something
> > MK doesn't do well and I thought you might be aiming for).
> No, that's not an issue -- I'm starting afresh.
> > Next
> > question: How do you handle inheritance?
> Not at all, I should think. Basically, I just want to wrap the SQL in
> some Pythonic syntax, not represent arbitrary objects as SQL.
> On the other hand, PostgreSQL has direct support for table
> inheritance, so it should be easy to do that, if I so wanted.
> > Does each class get its own whole table?
> Yes. Subclasses would get tables that inherited from the table of the
> superclass, I guess. (This would all be tied to Postgres, but I don't
> think I'll be porting it any time soon anyway, so...)
> > Or do all Workers go in the
> > same table? Or does each class get its own table only with its
> > additional attributes?
> > How is a reference to a Worker stored in the db?
> Ah. That would be a problem in the case if inheritance/polymorphism,
> of course. I'm not quite sure. I guess I'd have to be able to
> reference th
> e table somehow... But I'm not sure how that would work in
> SQL. I guess I'd have to implement some of the logic in Python. (I.e.
> a reference has a table name and an object ID -- the Python code
> extracts the table name and constructs an SQL command for selecting
> the object from the given table.)
> As an aside: In Postgres (if I'm tied to it anyway), is it OK to use
> the implicid OID column instead of constructing a serial ID column? It
> seems to be what it's there for, but in all the examples I've seen,
> there has been a separate ID column -- perhaps to make the schema
> portable to other databases?
> > As the original author of MiddleKit, I'm all too familiar with these
> > issues. :-)
> That I can imagine :)
> > -Chuck
> Magnus Lie Hetland The Anygui Project
> http://hetland.org http://anygui.org
> Webware-discuss mailing list