How to define a table without primary key with SQLAlchemy?

前端 未结 4 459
忘了有多久
忘了有多久 2021-01-17 07:09

I have a table that does not have a primary key. And I really do not want to apply this constraint to this table.

In SQLAlchemy, I defined the

4条回答
  •  滥情空心
    2021-01-17 07:57

    There is only one way that I know of to circumvent the primary key constraint in SQL Alchemy - it's to map specific column or columns to your table as a primary keys, even if they aren't primary key themselves. http://docs.sqlalchemy.org/en/latest/faq/ormconfiguration.html#how-do-i-map-a-table-that-has-no-primary-key.

提交回复
热议问题