Question

Just wanted to know if it is possible to create database triggers in a MySQL database using web2py's DAL? If not what alternatives are available?

I need some way of linking back to some python code from a trigger that happens in MySQL.

Thanks in advance, nav

Was it helpful?

Solution

The web2py DAL does not have specific syntax for creating triggers, but you can execute any SQL statements via db.executesql(). As an alternative, the web2py DAL includes its own before and after callbacks, which will work across different database backends.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top