diff --git a/callback.go b/callback.go index 11eb0006..399ed85b 100644 --- a/callback.go +++ b/callback.go @@ -29,6 +29,10 @@ func (c *callback) addProcessor(typ string) *callback_processor { return cp } +func (c *callback) clone() *callback { + return &callback{processors: c.processors} +} + func (c *callback) Create() *callback_processor { return c.addProcessor("create") } diff --git a/main.go b/main.go index a72e091f..a1b6c5f9 100644 --- a/main.go +++ b/main.go @@ -32,6 +32,11 @@ func (s *DB) DB() *sql.DB { return s.db.(*sql.DB) } +func (s *DB) Callback() *callback { + s.parent.callback = s.parent.callback.clone() + return s.parent.callback +} + func (s *DB) SetTagIdentifier(str string) { s.parent.tagIdentifier = str }