From 231075f28df55bfb622f54859f858528445cae0c Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Thu, 30 Sep 2021 11:16:23 +0200 Subject: Golint (#255) --- internal/db/bundb/bundb.go | 2 ++ internal/db/bundb/conn.go | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'internal/db') diff --git a/internal/db/bundb/bundb.go b/internal/db/bundb/bundb.go index e1879f247..e6ebe5d88 100644 --- a/internal/db/bundb/bundb.go +++ b/internal/db/bundb/bundb.go @@ -45,6 +45,8 @@ import ( "github.com/uptrace/bun/dialect/pgdialect" "github.com/uptrace/bun/dialect/sqlitedialect" "github.com/uptrace/bun/migrate" + + // blank import for the sqlite driver for bun _ "modernc.org/sqlite" ) diff --git a/internal/db/bundb/conn.go b/internal/db/bundb/conn.go index abaebcebd..aeb1b5db0 100644 --- a/internal/db/bundb/conn.go +++ b/internal/db/bundb/conn.go @@ -10,7 +10,7 @@ import ( "github.com/uptrace/bun/dialect" ) -// dbConn wrapps a bun.DB conn to provide SQL-type specific additional functionality +// DBConn wrapps a bun.DB conn to provide SQL-type specific additional functionality type DBConn struct { // TODO: move *Config here, no need to be in each struct type @@ -37,6 +37,7 @@ func WrapDBConn(dbConn *bun.DB, log *logrus.Logger) *DBConn { } } +// RunInTx wraps execution of the supplied transaction function. func (conn *DBConn) RunInTx(ctx context.Context, fn func(bun.Tx) error) db.Error { // Acquire a new transaction tx, err := conn.BeginTx(ctx, nil) -- cgit v1.2.3