Use events with expression api

8 views
Skip to first unread message

brian...@blue-newt.com

unread,
Sep 30, 2020, 4:31:15 PM9/30/20
to sqlalchemy-alembic
Is there a way to use events with the expression api? I see how they're used with ORM and Core but not expressions.

Thanks,
Brian

Mike Bayer

unread,
Sep 30, 2020, 5:03:31 PM9/30/20
to sqlalchem...@googlegroups.com
SQL expressions are intercepted by the SQL Execution events described at https://docs.sqlalchemy.org/en/13/core/events.html#sql-execution-and-connection-events and the main ones are before_execute() and before_cursor_execute(), but it depends on what you want to do.    if you want to change how expressions are compiled to strings you would redefine their compilation as described at https://docs.sqlalchemy.org/en/13/core/compiler.html.



On Wed, Sep 30, 2020, at 9:27 PM, brian...@blue-newt.com wrote:
Is there a way to use events with the expression api?

I see how they're used with ORM and Core, but not expressions.

Thanks,
Brian


--
You received this message because you are subscribed to the Google Groups "sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy-alem...@googlegroups.com.

Brian Hill

unread,
Sep 30, 2020, 7:56:26 PM9/30/20
to sqlalchem...@googlegroups.com
I was to associate/call functions when specific tables and columns are updated.

Sent from my iPad

On Sep 30, 2020, at 5:03 PM, Mike Bayer <mik...@zzzcomputing.com> wrote:


Reply all
Reply to author
Forward
0 new messages