autogenerate event model

Issue #8 wontfix
Michael Bayer
repo owner created an issue

was previously: run autogen diffs through the context, give them a chance to update, include MSSQL flags for default/check

The key event we need is some way to intercept the diff stream. I'm not sure yet if we should consider a full blown event system, which if we were to do that I'd use SQLAlchemy's event dispatch system as the basis, though if we were to do that I'd like to identify many points throughout Alembic where this would be appropriate.

Or smaller scale, just a function that we pass to the environment that receives the diff stream may be all that's needed.

In particular we need to support the use case of systems that use customized metadata schemes, such as Column subclasses, automated column/constraint additions, and others, so that the generated schema objects match the conventions in use by the application. Ideally we should add much more of a document building on the start of things at for how to build Column subclasses, table events, all of that, and then also have it integrate with Alembic events too.

Comments (3)

  1. Michael Bayer reporter

    there's not yet been a need for this. if we find a place where generic event listening seems appropriate, we can add it; but so far it seems more appropriate at the moment to stick with the idea of sending callables to environment.configure().

  2. Log in to comment