[Dbix-class] Auditing - (was Optimistic locking)

Dan Horne dan.horne at redbone.co.nz
Sat Aug 5 20:10:39 CEST 2006


> 
> If you're doing that, can you bear in mind that it'd rock if we could
> extend
> that later to add change auditing please? :)
> 
> (I was going to implement that but the project I needed it for got
> cancelled
> so it's gone onto the back-burner for the mo)
> 

What would auditing consist of? For instance, I wrote a simple Perl script
to generate triggers for Oracle tables that would record all changes against
the base table in an audit table with the following definition

        lkau_id       -- the audit table key
        username      -- the user who has made the change
        table_name    -- the name of the table being altered
        tbl_key       -- the primary key value. Composite key values are
                         separated by the delimiter defined in the
                         KEY_DELIMITER constant
        column_name,  -- the name of the column that is changing
        before_value, -- the value before the change. New rows have no
                         old values
        after_value,  -- the value after the change. Deleted rows have no
                      -- after value
        updated       -- when the change was made

Are you wanting something similar as a DBIC component? I guess there would
be a performance hit - each update would need to select the old values
again, but I guess that anyone who wants audit would realise that there is
an overhead anyway.

I'm not sure how username would be deduced, or even explicitly set.

Dan




More information about the Dbix-class mailing list