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 committed Apr 20, 2024
1 parent e8a1d88 commit 0ab5f1a
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 0ab5f1a

Please sign in to comment.