summaryrefslogtreecommitdiff
path: root/internal/db
diff options
context:
space:
mode:
Diffstat (limited to 'internal/db')
-rw-r--r--internal/db/bundb/bundb.go2
-rw-r--r--internal/db/bundb/conn.go3
2 files changed, 4 insertions, 1 deletions
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)