Skip to content

Commit

Permalink
DB#Upsert(): workaround jmoiron/sqlx#694
Browse files Browse the repository at this point in the history
  • Loading branch information
Al2Klimov committed Apr 12, 2021
1 parent 9cefcb4 commit 6ad6088
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions icingadb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,11 @@ func (db DB) Upsert(ctx context.Context, entities <-chan contracts.Entity, succe
return err
}

stmt, placeholders := db.BuildUpsertStmt(first)
return db.NamedBulkExec(ctx, stmt, 1<<15/placeholders, 1<<3, forward, succeeded)
// TODO(ak): wait for https://github.com/jmoiron/sqlx/issues/694
//stmt, placeholders := db.BuildUpsertStmt(first)
//return db.NamedBulkExec(ctx, stmt, 1<<15/placeholders, 1<<3, forward, succeeded)
stmt, _ := db.BuildUpsertStmt(first)
return db.NamedBulkExec(ctx, stmt, 1, 1<<3, forward, succeeded)
}

func (db DB) Update(ctx context.Context, entities <-chan contracts.Entity) error {
Expand Down

0 comments on commit 6ad6088

Please sign in to comment.