I'm using SQLAlchemy's declarative system to define my mapping. Afterwards, I make sure the corresponding tables exist via
Base.metadata.create_all(engine, checkfirst=True)
If I afterwards change one of my declarative classes (for example by adding a column) and run the program again then that change is only detected when I try to commit a session including an instance of that modified class. That happens at a relatively late time during the program's runtime. I would prefer to detect that problem during startup so that I can fail early.
How can I explicitly ask SQLAlchemy to check whether the existing tables match my declarative mapping?
Note that I'm not necessarily looking for how to detect what has changed or how to perform the corresponding migration -- I just want to know whether my tables match my mapping or not.