How to discover table properties from SQLAlchemy mapped object

Information you need you can get from Table object:

  • Ship.__table__.columns will provide you with columns information
  • Ship.__table__.foreign_keys will list foreign keys
  • Ship.__table__.constraints, Ship.__table__.indexes are other properties you might find useful

Leave a Comment