On Thursday, July 16, 2015 at 6:54:29 AM UTC-4, Ivan Ogasawara wrote:
>
> I think you can write a trigger in your DB  for all tables and actions you 
> want to analyze .. and your triggers you can put the changes in some log 
> tables.
>
> Using sqlalchemy you can put this changes inside your db functions.
>

I would also recommend using triggers to manage a change log or other type 
of history. If you're using SQLAlchemy only for all changes, you could 
probably accomplish the same thing using SQLAlchemy events, but database 
triggers are a better way to ensure everything is recorded. I do use 
SQLAlchemy core and ORM to read the trigger-maintained history data in its 
tables and views.

I've been using PostgreSQL triggers to maintain several types of change 
logs. More recently, I've also started storing table history in 
transaction-time and bitemporal state tables, which is a form closer to the 
current table and therefore allows for more straightforward and powerful 
queries about facts in the past.

<URL:https://en.wikipedia.org/wiki/Temporal_database>

-- 
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.

Reply via email to