Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reflect database objects using Pony ORM?

I have an existing MySQL database that I want to reflect using PonyORM.

I know I'm able to do that with SQLAlchemy:

engine = create_engine(...)
Base = declarative_base(metadata=MetaData(bind=engine))
...
...
class MyTable(Base):
    __table__ = Table('table_name', Base.metadata, autoload=True)

Is there a similiar way to do the same with PonyORM? I couldn't find information about that in the website.

like image 603
Maroun Avatar asked Jul 10 '14 11:07

Maroun


People also ask

What is pony ORM?

What is Pony Orm? Pony ORM is a free, open-source Python language library that makes database interactions easy.


1 Answers

Currently PonyORM does not have something like autoload=true, so entities have to be declared in Python. We can add support of database reflection in the future.

like image 158
Alexander Kozlovsky Avatar answered Sep 25 '22 12:09

Alexander Kozlovsky