[chore] Update a bunch of database dependencies (#1772)

* [chore] Update a bunch of database dependencies

* fix lil thing
This commit is contained in:
tobi 2023-05-12 14:33:40 +02:00 committed by GitHub
commit ec325fee14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
402 changed files with 35068 additions and 35401 deletions

View file

@ -97,10 +97,15 @@ func Exec(ctx context.Context, db *bun.DB, f io.Reader, isTx bool) error {
}
var retErr error
var execErr error
defer func() {
if tx, ok := idb.(bun.Tx); ok {
retErr = tx.Commit()
if execErr != nil {
retErr = tx.Rollback()
} else {
retErr = tx.Commit()
}
return
}
@ -113,8 +118,9 @@ func Exec(ctx context.Context, db *bun.DB, f io.Reader, isTx bool) error {
}()
for _, q := range queries {
if _, err := idb.ExecContext(ctx, q); err != nil {
return err
_, execErr = idb.ExecContext(ctx, q)
if execErr != nil {
return execErr
}
}