{"repo":"flume/enthistory","free":true,"listed":false,"github":"https://github.com/flume/enthistory","clone":"git clone https://github.com/flume/enthistory.git","description":"History tables for ent","language":"Go","stars":57,"topics":["ent","entity-framework","go","golang","orm"],"license":"MIT","category":"databases-storage","readme_excerpt":"enthistory enthistory is a powerful extension for generating history tables using ent. Installation You can install enthistory by running the following command: In addition to installing enthistory, you need to create two files in your ent directory: entc.go and generate.go . The entc.go file should contain code similar to below: The generate.go file should contain the following code: Note: Breaking change introduced in enthistory version v0.12.0, if you are upgrading please see the example file above for the new way to use the enthistory extension. Usage Customizing History Schemas You can customize the history tables to an extent by using enthistory.Annotations{} annotation on the original schema. You can set custom annotations for the history schemas or add custom mixins. Adding custom annotations or mixins will overwrite the default annotations and mixins inherited from the original schema, so you need to include them if you want to keep the original annotations and mixins. Custom Mixins add the ability to add history specific policies, hooks, interceptors, etc. to the history table as well. You can also set custom triggers for tracking history on a schema level. The triggers can be any combination of OpTypeInsert , OpTypeUpdate , OpTypeDelete . If you want to set a global trigger set for all schemas you can set the triggers in the enthistory.Generate() function. Querying History After generating your history tables from your schema, you can use the ent client to query th","default_branch":null,"files":null,"tree":[],"storefront":"/r/flume","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/flume/enthistory/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}