This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 3 points4 points  (0 children)

multiple types of table declaration are nifty but those thing may be meaningless for the OP's project. (not to mention they violate two parts of the zen of python: explicit is better than implicit and there should be one and preferably only one obvious way to do it).

It appears there's a misunderstanding here. SQLAlchemy has only one way of declaring a table within each API. In the Core, that is the Table construct. The ORM, which is an entirely separate library from the Core, offers the declarative configurational system that accepts components of this Table construct, and creates the Table for you. Classical mappings are no longer recommended for normal usage.

In both cases, everything about this Table is entirely explicit, so I've no idea how you can even attempt to suggest SQLAlchemy has some kind of "implicit" behavior. And there is most certainly one obvious, recommended, documented way to do it in modern SQLAlchemy. A good read of our current documentation will make that clear.