Skip to content

dbworker/store: add With method

Warren Gifford requested to merge mrn/dbworker-store-with into main

Created by: mrnugget

This adds the (*store).With method that allows other stores to use the dbworker/store.Store with their own database handle.

Does anything speak against doing this?

I want to do this because when wrapping a dbworker/store.Store it's handy to do the following

func (s *myStore) MarkComplete(...) {
  tx, err := s.Transact()
  # [...]
  tx.DoCoolStuff()
  s.Store.With(tx).MarkComplete(...)
}

Merge request reports

Loading