Michael Bayer wrote: > The structure of the API would drive the current reflection API to > become more componentized. What we see as a need on the "public > refleciton API" side would drive the currently monolithic "reflection" > methods to be changed. The current reflecttable() methods in turn > would ideally move *out* of the dialects, and the Table(autoload=True) > functionality would simply call up an Inspector and use that. So the > ultimate outcome is that the individual "reflecttable" methods go > away, and dialects implement a larger set of simpler methods. >
I started by factoring out components for reflecttable. So now there are methods get_columns, get_primary_keys, get_foreign_keys, get_indexes and get_views. get_columns, get_primary_keys, and get_foreign_keys are the methods used by reflecttable (and the ones I actually implemented). There is one thing I did that will slightly degrade performance. I created a method in postgres.py __get_table_oid that several other methods use. This value could be cached at the beginning of reflecttable, but I didn't won't to address threading issues. I made a local branch called reflection and have attached the files and diffs for engine/base.py and databases/postgres.py at revision 5262. I did a few real world tests, but not the automated tests. I don't know how difficult they are to set up. That'll be the next thing I do. Mainly I just want to get feedback on the API and if I'm going about the implementation right. --Randall --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
base.py.diff.gz
Description: GNU Zip compressed data
base.py.gz
Description: GNU Zip compressed data
postgres.py.diff.gz
Description: GNU Zip compressed data
postgres.py.gz
Description: GNU Zip compressed data