Skip to content

Is it possible to create trigger on all tables by modifying declarative_base? #1478

Discussion options

You must be logged in to vote

So I was thinking if the Base can be used for this purpose.

SQLAlchemy has no notion of a "trigger" object directly, and the feature you are using with Base is specific to ORM mapped attributes that map to database columns. So there is no facility in Alembic autogenerate to read records from a Base class with a mapped table and then generate "triggers".

alembic_utils does have an explicit "trigger" notion but I am not familiar with the extent to which it has produced an "autogenerate" feature which would work from some metadata-level directives to produce them. if it did, you still could not use Base.column = Column() because that feature only applies to mapped columns; you instead woul…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@hidetatz
Comment options

@zzzeek
Comment options

Answer selected by hidetatz
@hidetatz
Comment options

@stephanschielke
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants