On Friday, January 23, 2015 at 12:48:46 PM UTC-5, SF Markus Elfring wrote: > > Should the Python class be sufficient for the definition > of a table structure? >
If you're using the declarative syntax, yes. It's common to have a `models.py` file that simply defines the classes in one place; then that is imported and metadata associated to the engine. > Will the mapping interface work also without tables > that were created by other SQL scripts before? SqlAlchemy is one of the very few ORMs that does not impose any design requirements. Classes/Tables can be easily mapped to any legacy scenario. The only issue that arises is if there are complex relationships/joins -- then special mappers may be needed. There is an extended section in the docs for that, but it is a rare and advanced topic. There are also 3rd party packages like sqlacodegen (https://pypi.python.org/pypi/sqlacodegen) that can query a legacy database for you and generate the corresponding SqlAlchemy python classes. -- 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. For more options, visit https://groups.google.com/d/optout.