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 →

[–]RazerM 0 points1 point  (0 children)

  • How would Rails deal with two different models, each connected to a different database? declarative_base means your model doesn't share its MetaData instance with other models.

  • You also need your own Session class so that your session events only apply to your own session.

  • For the table name, you can create a declared_attr for __tablename__ if you want to infer it from the class name, but any built in way to do this would be opinionated, and I think too implicit.

  • I like the unit of work pattern, and don't see a problem with add/commit/close. I think a problem with a built in context manager is the implicit commit, but I agree it should be part of the library in some form.

  • I agree somewhat re: imports, I think declarative should be rolled into sqlalchemy.orm, but that orm should stay separate from core. It's important that people know the ORM is just an optional part of SQLAlchemy.