I created a database manually using simple sqlite3 in python. When I load tables in that database using SqlAlchemy's reflection mode, i.e. setting autoload=True, I know all the columns will be reflected and mapped to the corresponding classes. However, I'm NOT so sure if the following details will also be reflected automatically:
1) foreign_keys flag For example, if I already set PRAGMA foreign_keys=ON when I created that database, do I still need to set up an event listener to set that flag for each session when they connect to the database? Or this will be reflected automatically? 2) relationships between two tables Here I mean if a relationship that is not ambiguous, for example, Users and Addresses, do I still need to type in and explicitly define an address attribute in Users class? Could this be deduced by SqlAlchemy automatically? (I tried but failed, but I think this might make sense if SqlAlchemy can do this automatically when reflecting) 3) constraints Currently when I examine the __table__ attribute I simply cannot find any constraint listed there. I set several ON DELETE RESTRICT, ON UPDATE CASCADEwhen I created this database but they are not visible to me even after autoload=True. I'd really appreciate some insight here. Thanks in advance. -- 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.