On Tue, Dec 1, 2015 at 8:17 AM, Chris Withers <ch...@simplistix.co.uk> wrote:
> Hi All, > > Where can I find documentation on the parameters taken by event.listen? > I have some listeners on instrument_class that pass propagate=True, but I > can't find docs on what that means? > I think the parameters depend on the type of event that you are listening for. "propagate" is a valid parameter for various ORM-related events: http://docs.sqlalchemy.org/en/rel_1_0/orm/events.html > > I'm also looking for two events to listen to: > > - once at 'database creation' time, so set up some stored procedures. (I > know SQLAlchemy doesn't create databases itself, so interested in the > correct approach for this) > > - one that fires on all table creation that uses a mixin, so that I can > register the created stored procedure as a trigger. > > The docs suggest that you can use a MetaData object as the source for DDL events - I assume you could use this to be notified for all table creation events. http://docs.sqlalchemy.org/en/rel_1_0/core/events.html#sqlalchemy.events.DDLEvents However, this would be at the Core level, so it may not be possible to inspect the class associated with the table at that point (I don't know). If you can't, perhaps you could use one of the ORM events to install a listener on the specific table. Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.