aboutsummaryrefslogtreecommitdiff
path: root/backend/storage/db.go
diff options
context:
space:
mode:
Diffstat (limited to 'backend/storage/db.go')
-rw-r--r--backend/storage/db.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/backend/storage/db.go b/backend/storage/db.go
index 7a7c6e0..0ee50da 100644
--- a/backend/storage/db.go
+++ b/backend/storage/db.go
@@ -13,6 +13,8 @@ import (
_ "github.com/mattn/go-sqlite3"
)
+const DBKey = "db"
+
//go:embed migrations
var migrations embed.FS
@@ -66,3 +68,7 @@ func RunMigration(ctx context.Context, db *sql.DB) error {
}
return nil
}
+
+func getDB(ctx context.Context) *sql.DB {
+ return ctx.Value(DBKey).(*sql.DB)
+}