I am new to Sqlalchemy and ORM in general.  I also have a slightly odd
use case. My existing database is a set of very simple tables.  Each
table has the exact same layout/columns just different names, for
different collections of information.  So I looked through the
Documentation and it seems to get this to work I would have to create
a different class instance for each table, even though they have the
same layout. Using reflection with autoload means I need to edit the
code for every new table (could be dozens) with empty class
definitions.  The autoload per table to create objects where the
columns were members of the class (ie mytable.mycolumn)

This presents a maintenance issue I would like to avoid.  So I tried
using 'meta.reflect(bind=engine)' which does indeed read all my tables
in without the maintenance issues.  However it creates generic Table()
classes with no interface additions for the columns. This makes my
queries basic SQL with some added sqlalchemy calls to get the table
and dereference the columns.  Also not desirable.

I believe this is due to the fact that Sqlalchemy chooses to modify
the class definitions on reflection as opposed to class instances.  Is
there an easy way to flip this so that the result is a list of table
objects that behave as a manually prepared/loaded/reflected object?  I
am guessing no, but wanted to check with the experts before giving up
and using non-ORM straight SQL.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to