Hi, I am trying to set a session variable (call a function with a value) in postgres at the beginning of every session that SQLAlchemy starts. I'm using the session variable to specify the currently logged in user for an auditing system (just a trigger on a couple tables). I have tried the before_commit ORM event, but it will set the variable after the other commands so the trigger does not pick it up. I also tried the before_flush event, but it seems to have a simlar problem -- it doesn't always set the variable at the beginning of the session.
Is there a way to run a command at the beginning of every session, before anything else is run? Also, in these cases should I be using Session.execute or Session.connection.execute()? Thanks -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
