There is an existing database on PostgreSQL Using SQLAlchemy, I implemented the schema of this database. There is a way using SQLAlchemy (or a separate Python package) to check whether I made a mistake when describing the schema. Interviews everything: table names, fields (their type and length), primer and forward range Kay

    1 answer 1

    It will be easier when building a scheme to use metadata from the database using DB object reflection :

     messages = Table('messages', meta, autoload=True, autoload_with=engine) [c.name for c in messages.columns] #['message_id', 'message_name', 'date'] 

    Limitations :

    Limitations of Reflection

    It is important to note the metadata. This isn’t exactly what you’re actually stored in the database. State of which is not limited to reflection:

    Client side defaults, either expressions or expressions defined using the phrases (note this is separate from server_default, which is available via reflection). Column information, for example, where you can find the correct information. SQLAlchemy. It is not necessary to make sure that the DDL has been chosen. Areas where this occurs includes server defaults, column-associated sequences and various idosyncrasies regarding constraints and datatypes. It will be possible to send a message to the server.

    This is a partly limitation. Reflected. Constraints, table comments, and triggers are not reflected.