PetaPoco icon indicating copy to clipboard operation
PetaPoco copied to clipboard

Extra data for table/column metadata

Open JCKodel opened this issue 11 years ago • 1 comments

I'm using an altered version of PetaPoco that includes database operations in a history table (TableName, Date and a JSON with the current poco version).

For this, I've created a new attribute called DontKeepHistoryAttribute that will turn off this behavior for some tables.

It would be nice if, in database.tt, we could set some extra parameters as a dictionary, i.e.:

tables["Security.Audits"]["ExtraData"]["DontKeepHistory"] = true;

and maybe an OnBeforeExecuteCommand and OnAfterExecuteCommand as partial methods where we could check this "DontKeepHistory" flag to do some action.

JCKodel avatar Apr 01 '13 17:04 JCKodel

Hi,

I wat to add a comment on this.

For tracking user changes we are using a common interface with creation and modify user / date. It will be really useful to have a funcion hook where to assign the current user and date.

In our repository implementation we have two events "OnBeforeCommit" and "OnAfterCommit" that receives in input a flat list of persisted entities.

At this point it will be easy to check for an interface implementation and do something.

Thanks, Enrico

enrico-padovani avatar Mar 02 '16 06:03 enrico-padovani