Another thought... I implemented this a while ago but never committed it
as there wasn't a great way to fit this into the architecture.  I wanted
to dynamically generate the KeyDef (if not provided), but the timing of
when the Schema was created made things very difficult.  Now that the
Schema statically handles creating a Schema object, I think this will
work nicely.

The DatabaseMetaData object allows you to get the list of primary keys
for a given table.  I was thinking we could add a default KeyDef object
to each Schema, and then if a KeyDef wasn't provided, the TableDataSet
could use the schema's keydef by default.  The schema can do this right
after getting all column information, and wrap the whole key lookup in a
big try block so if you're using a driver that doesn't support this,
this won't affect you (and since the Schema object is only created once
per table, this will affect performance negligibly).  Sound reasonable? 
I've got diffs from when I originally wrote this (but never committed),
so it'll be easy to refit into the current design.

Serge Knystautas
Loki Technologies
http://www.lokitech.com/


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to