Skip to content

Plugin transaction callbacks and transaction scoped variables #5855

@iwarapter

Description

@iwarapter

Describe the feature

Transaction callbacks for plugins. I'd like to implement a Plugin that can create revision records for audited models. For this i need to be able to hook into the transaction lifecycle and be able to set a variable (revisionid) for the transaction.

Motivation

I'm currently working on a opensource plugin to implement https://hibernate.org/orm/envers/ for gorm. Which i'd like to see join https://github.com/go-gorm if its good enough.

Related Issues

I have tested with #5492 but am unable to use with db.Set or db.InstanceSet to persist variables for the entire transactions.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions