Reputation: 1199
I have a situation where i load all tables from legacy database. but it gives an error since it does not have any primary keys.
Can anyone give me a solution for this error ?
Upvotes: 3
Views: 203
Reputation: 3535
You can add the primary key information to the autoloaded table.
e.g.
class Subscrib(Base):
__tablename__ = 'mytable'
__table_args__ = {'autoload' : True}
thepk = Column(Integer, primary_key=True)
Upvotes: 1