Pg to bun (#148)

* start moving to bun

* changing more stuff

* more

* and yet more

* tests passing

* seems stable now

* more big changes

* small fix

* little fixes
This commit is contained in:
tobi 2021-08-25 15:34:33 +02:00 committed by GitHub
commit 2dc9fc1626
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
713 changed files with 98694 additions and 22704 deletions

View file

@ -136,7 +136,7 @@ func (f *federatingDB) Update(ctx context.Context, asType vocab.Type) error {
accountable = i
}
updatedAcct, err := f.typeConverter.ASRepresentationToAccount(accountable, true)
updatedAcct, err := f.typeConverter.ASRepresentationToAccount(ctx, accountable, true)
if err != nil {
return fmt.Errorf("UPDATE: error converting to account: %s", err)
}
@ -152,7 +152,8 @@ func (f *federatingDB) Update(ctx context.Context, asType vocab.Type) error {
}
updatedAcct.ID = requestingAcct.ID // set this here so the db will update properly instead of trying to PUT this and getting constraint issues
if err := f.db.UpdateByID(requestingAcct.ID, updatedAcct); err != nil {
updatedAcct, err = f.db.UpdateAccount(ctx, updatedAcct)
if err != nil {
return fmt.Errorf("UPDATE: database error inserting updated account: %s", err)
}