diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2025-12-22 18:51:42 +0100 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2025-12-22 18:51:42 +0100 |
| commit | 9ad7b0e67c90697893f188323a32590fbecd5a65 (patch) | |
| tree | 41c8684a652e8fc5dbedb07bdde6404df4afb628 /backend/storage/db.go | |
| parent | cbd5c09c5e1403709d4aabf91051443f147689e5 (diff) | |
fix(storage): does not store stats if request fails
Diffstat (limited to 'backend/storage/db.go')
| -rw-r--r-- | backend/storage/db.go | 6 |
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) +} |
