Bbse classes to use on Persistent (table) classes for InterSystems IRIS to keep record history
These classes enable the historizing of persistent class records into another persistent class when touched.
This provides for a full history of any record.
It allows for record rollback to a specific version.
It can automatically purge old history records.
zpm “install csoftsc-persistent-audit”
The usage sample is available in the GitHub repo
git clone https://github.com/csoft-sc/iris-table-audit.git
docker-compose up -d
docker-compose exec iris iris session iris -U IRISAPP
|/src/csoftsc/PersistentAudit||Source to use and include in your deployment|
|/src/csoftsc/Demo||A demonstration of usage|
The generated triggers are set to run on row/object, which means it applies to Object-level and SQL operations.
The triggers are orderred at number 10, which means you can still let your own triggers execute before or after the historization triggers.
To disable the auto historizing of records for a Persistent Class, set the ^PersistentAuditOff(“MyPackage.ClassName”) to 1
^PersistentAuditOff("csoftsc.Demo.Customer") = 1
To keep only a specific number of history records, set the ^PersistentAuditAutoPurge(“MyPackage.ClassName”) to the number of history records to keep
If not set, or tod less than or equal to 0, auto archiving will not be done.
^PersistentAuditAutoPurge("csoftsc.Demo.Customer") = 2
The class that extends from the base will contain two class methods that are available as Stored Procedures as well.
Set tSuccess = ##class(csoftsc.Demo.Customer).RestoreVersion(tCust.%Id(),4)
&sql(:tSuccess = call csoftsc_Demo.Customer_RestorePreviousVersion(:tId))
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the https://github.com/baasvancodeza/iris-table-audit/blob/main/LICENSE file for details.
Moved to a different github repo
Added the files needed to run the demo in a container.
Added small volumes to the demo to show the impact on speed.