Updating TxHandler to accept a reader as well in order to support reads inside the same transactions as writes. (#139)

This commit is contained in:
Todd Knight authored and GitHub committed 2020-06-22 13:27:26 -07:00
1 parent 6908f7a7a2
commit 0c8385b423
4 files changed
+25 -24

No files matched your search

+3 -3
View File
@@ -77,7 +77,7 @@ func (r *Repository) CreateCatalog(ctx context.Context, c *HostCatalog, opt ...O
ctx,
db.StdRetryCnt,
db.ExpBackoff{},
func(w db.Writer) error {
func(_ db.Reader, w db.Writer) error {
newHostCatalog = c.clone()
return w.Create(
ctx,
@@ -148,7 +148,7 @@ func (r *Repository) UpdateCatalog(ctx context.Context, c *HostCatalog, fieldMas
ctx,
db.StdRetryCnt,
db.ExpBackoff{},
func(w db.Writer) error {
func(_ db.Reader, w db.Writer) error {
returnedCatalog = c.clone()
var err error
rowsUpdated, err = w.Update(
@@ -211,7 +211,7 @@ func (r *Repository) DeleteCatalog(ctx context.Context, id string, opt ...Option
ctx,
db.StdRetryCnt,
db.ExpBackoff{},
func(w db.Writer) error {
func(_ db.Reader, w db.Writer) error {
deleteCatalog = c.clone()
var err error
rowsDeleted, err = w.Delete(