[bugfix] fix double firing bun.DB query hooks (#2124)

* improve bun.DB wrapping readability + comments, fix double-firing query hooks

* fix incorrect code comment placement

* fix linter issues

* Update internal/db/basic.go

* do as the linter commmands ...

---------

Signed-off-by: kim <grufwub@gmail.com>
Co-authored-by: Daenney <daenney@users.noreply.github.com>
This commit is contained in:
kim 2023-08-17 17:26:21 +01:00 committed by GitHub
commit d5d6ad406f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 645 additions and 535 deletions

View file

@ -110,7 +110,7 @@ func (suite *MediaCreateTestSuite) SetupSuite() {
}
func (suite *MediaCreateTestSuite) TearDownSuite() {
if err := suite.db.Stop(context.Background()); err != nil {
if err := suite.db.Close(); err != nil {
log.Panicf(nil, "error closing db connection: %s", err)
}
testrig.StopWorkers(&suite.state)

View file

@ -19,7 +19,6 @@ package media_test
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io/ioutil"
@ -107,7 +106,7 @@ func (suite *MediaUpdateTestSuite) SetupSuite() {
}
func (suite *MediaUpdateTestSuite) TearDownSuite() {
if err := suite.db.Stop(context.Background()); err != nil {
if err := suite.db.Close(); err != nil {
log.Panicf(nil, "error closing db connection: %s", err)
}
testrig.StopWorkers(&suite.state)