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 0efa4f6
Showing 1 changed file with 2 additions and 2 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

0 comments on commit 0efa4f6

Please sign in to comment.