SQLAlchemy Automap does not create class for tables without primary key

前端 未结 1 701
小蘑菇
小蘑菇 2020-12-15 17:30

I am using SQL Alchemy v(0.9.1) which has the automap functionality. This allows me to create classes and relationships automatically. http://docs.sqlalchemy.org/en/rel_0_9/

相关标签:
1条回答
  • 2020-12-15 18:10

    Figured it out by combing through the reference/reframing the problem.

    In case it helps someone else -

    Because SQLAlchemy ORM is based on an identity map model, one cannot map (or automap) a table that does not have a primary key. An arbitrary primary key should be specified.

    http://docs.sqlalchemy.org/en/latest/faq/ormconfiguration.html#how-do-i-map-a-table-that-has-no-primary-key

    0 讨论(0)
提交回复
热议问题