Skip to content

Commit

Permalink
Use new Upsert and Delete structs
Browse files Browse the repository at this point in the history
  • Loading branch information
jrauh01 committed Nov 28, 2023
1 parent b7d3bce commit 9b4b98b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/sync/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (ls *LogSync) MaintainList(ctx context.Context, addChannel <-chan contracts
})

g.Go(func() error {
return ls.db.DeleteStreamed(ctx, &schema.Log{}, deletes, database.ByColumn("reference_id"))
return database.NewDelete(ls.db).ByColumn("reference_id").Stream(ctx, &schema.Log{}, deletes)
})

return g.Wait()
Expand Down Expand Up @@ -244,7 +244,7 @@ func (ls *LogSync) Run(ctx context.Context) error {
})

g.Go(func() error {
return ls.db.UpsertStreamed(ctx, upserts, database.WithStatement(upsertStmt, 5))
return database.NewUpsert(ls.db).WithStatement(upsertStmt, 5).Stream(ctx, upserts)
})

return g.Wait()
Expand Down
4 changes: 2 additions & 2 deletions pkg/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (s *sync) Run(ctx context.Context, execOptions ...SyncOption) error {
}

g.Go(func() error {
return s.db.UpsertStreamed(ctx, upsertToStream)
return database.NewUpsert(s.db).Stream(ctx, upsertToStream)
})

// init delete channel spreader
Expand Down Expand Up @@ -235,7 +235,7 @@ func (s *sync) Run(ctx context.Context, execOptions ...SyncOption) error {
})

g.Go(func() error {
return s.db.DeleteStreamed(ctx, s.factory(), deleteToStream)
return database.NewDelete(s.db).Stream(ctx, s.factory(), deleteToStream)
})

g.Go(func() error {
Expand Down

0 comments on commit 9b4b98b

Please sign in to comment.