summaryrefslogtreecommitdiff
path: root/internal/db/bundb/relationship_note.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-07-27 12:54:27 +0200
committerLibravatar GitHub <noreply@github.com>2023-07-27 12:54:27 +0200
commite747c14685920981920a467194dd4765c87248de (patch)
tree6e7b1f816767aa62a863e99e7a467c916f6208da /internal/db/bundb/relationship_note.go
parent[chore] update go-mp4 to latest commit (#2028) (diff)
downloadgotosocial-e747c14685920981920a467194dd4765c87248de.tar.xz
[chore] fix merge issue (#2029)
Diffstat (limited to 'internal/db/bundb/relationship_note.go')
-rw-r--r--internal/db/bundb/relationship_note.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/db/bundb/relationship_note.go b/internal/db/bundb/relationship_note.go
index 97e740bcd..022d9ba0c 100644
--- a/internal/db/bundb/relationship_note.go
+++ b/internal/db/bundb/relationship_note.go
@@ -32,7 +32,7 @@ func (r *relationshipDB) GetNote(ctx context.Context, sourceAccountID string, ta
ctx,
"AccountID.TargetAccountID",
func(note *gtsmodel.AccountNote) error {
- return r.conn.NewSelect().Model(note).
+ return r.db.NewSelect().Model(note).
Where("? = ?", bun.Ident("account_id"), sourceAccountID).
Where("? = ?", bun.Ident("target_account_id"), targetAccountID).
Scan(ctx)
@@ -49,7 +49,7 @@ func (r *relationshipDB) getNote(ctx context.Context, lookup string, dbQuery fun
// Not cached! Perform database query
if err := dbQuery(&note); err != nil {
- return nil, r.conn.ProcessError(err)
+ return nil, r.db.ProcessError(err)
}
return &note, nil
@@ -88,12 +88,12 @@ func (r *relationshipDB) getNote(ctx context.Context, lookup string, dbQuery fun
func (r *relationshipDB) PutNote(ctx context.Context, note *gtsmodel.AccountNote) error {
note.UpdatedAt = time.Now()
return r.state.Caches.GTS.AccountNote().Store(note, func() error {
- _, err := r.conn.
+ _, err := r.db.
NewInsert().
Model(note).
On("CONFLICT (?, ?) DO UPDATE", bun.Ident("account_id"), bun.Ident("target_account_id")).
Set("? = ?, ? = ?", bun.Ident("updated_at"), note.UpdatedAt, bun.Ident("comment"), note.Comment).
Exec(ctx)
- return r.conn.ProcessError(err)
+ return r.db.ProcessError(err)
})
}