I'm looking for details on implementing an audit table, either through sqla itself or in a way that plays nicely with sqla. It looks like there used to be an implementation of something like that at
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/LogVersions, does anyone know where that code lives now?
I figure there is probably a way to define the history table entirely in sqla, or perhaps preferably with db triggers. I'm using PostgreSQL / the trigger option is certainly available. If I go the trigger route ... is there a way to still have access to the history table object through sqla? I suppose I create a mapping to that table?
To illustrate the scenario, say I have a bank_account table:
bank_account
- id
- balance
And a history table for it:
bank_account_history
- bid
- timestamp
- balance
Should the history table implementation be done in sqla or should it be a db trigger with a sqla mapping? Either way I want to read from the history table with SQLA. Any pointers appreciated!