Object Databases

Andrew M. Kuchling akuchlin at mems-exchange.org
Wed Mar 1 17:14:33 EST 2000


Marc POINOT <poinot at onera.fr> writes:
> We have a kind of table/object description which is expected
> (suspected?) 
> to make this easier, but as a matter of fact it is not.

I was thinking of writing some simple schema declaration language,
re-using as much of Python's tokenise.py as possible.  Something like:

class Sequence using table sequences:
	id int
	name string
	Operation[] ops

class Operation:
	op_id int
	...

... and then something could parse this description, spit out SQL to
create the tables, generate SQL to map between two slightly different
schemas, automatically load & save objects.  But I need to go through
our current schema and note all the different relations that need to
be supported.

>Just to make you shiver (cry? laugh?), I send piece of code for
>a table description. Hint: an object is hidden in there...

It looks like you'd be much happier treating those lists and
dictionaries as intermediate output produced from some nice input
format, rather than writing them out by hand.  So maybe you could just
design an input format and write a parser.

-- 
A.M. Kuchling			http://starship.python.net/crew/amk/
Matey, if you asks my opinion, a-sitting there in the snow is not eggzackerly
the smartest thingie as you could be a-doing of, all things considerable.
    -- A passing hedgehog offers some advice, in SANDMAN #51: "A Tale of Two
       Cities"






More information about the Python-list mailing list