I am new to SQLAlchemy and I see that in the documentation the older version (Column) can be swapped directly with the newer "mapped_column".
Is there any advantage to using mapped_column over Column? Could you stick to the older 'Column'?
1 Answer
I think originally Column was used in the lower "core"/sqlalchemy.sql layer AND the higher ORM layer. This created a conflict of purpose. So mapped_column now supersedes Column when using the ORM layer to add more functionality that can't be used by the core layer. The core layer will keep using Column. So I think it is just meant to help you do more faster or more succinctly with the ORM.
There is a blurb about them titled "mapped_column() supersedes the use of Column()" below declarative-table-with-mapped-column.
1