Skip to content

Commit

Permalink
Made score calculations upsert the references.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Bruse authored and zond committed Apr 20, 2024
1 parent e8a1d88 commit 98a0934
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion go/data/study.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func (s *Study) Put(ref *Reference) error {
return err
}
if err := func() error {
_, err := tx.Exec("INSERT INTO OBJ (ID, DATA) VALUES (?, ?)", []byte(ref.Name), b)
_, err := tx.Exec("INSERT INTO OBJ (ID, DATA) VALUES (?, ?) ON CONFLICT (ID) DO UPDATE SET DATA = ?", []byte(ref.Name), b, b)
return err
}(); err != nil {
if rerr := tx.Rollback(); rerr != nil {
Expand Down

0 comments on commit 98a0934

Please sign in to comment.