On Monday, March 18, 2013 3:25:36 PM UTC-6, Peter Herndon wrote: > > Hi all, > > I'm new to SQLAlchemy, and looking for some advice on how to approach > working with an existing database. >
My preferred approach is to use http://code.google.com/p/sqlautocode/ and generate a module describing the schema. Then I tweak/cleanup/reformat the schema.py to my liking. For example I may use "key" argument in the Column definition to change the name or comment out add_date, add_user columns. Since the databases I work with are fairly stable it is an acceptable tradeoff. Although sqlautocode can produce the Declarative format I tend to stick with a separate schema.py and model.py defining classical mapping. I have been using SQLAlchemy since before Declarative was available (started with 0.1 series) and the classical mapping feels more natural. Also if I ever need to re-genrate schema.py my model/mapping is not affected. Waldemar -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. For more options, visit https://groups.google.com/groups/opt_out.