aboutsummaryrefslogtreecommitdiffstats
path: root/walrss/main.go
diff options
context:
space:
mode:
authorAKP <tom@tdpain.net>2022-08-13 17:21:55 +0100
committerAKP <tom@tdpain.net>2022-08-13 17:21:55 +0100
commit98690e4b9148a2f7084228b6f9adaca55e5a2f4f (patch)
tree492850eb6b4d12cf0d6ef6fa3fb4071e744c255c /walrss/main.go
parentc9aacf30c71246927e9acd7d26198a2e48683038 (diff)
Convert to SQLite
Signed-off-by: AKP <tom@tdpain.net>
Diffstat (limited to 'walrss/main.go')
-rw-r--r--walrss/main.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/walrss/main.go b/walrss/main.go
index a61ca51..6d2d135 100644
--- a/walrss/main.go
+++ b/walrss/main.go
@@ -6,6 +6,7 @@ import (
"github.com/codemicro/walrss/walrss/internal/rss"
"github.com/codemicro/walrss/walrss/internal/state"
"github.com/rs/zerolog/log"
+ "github.com/uptrace/bun/extra/bundebug"
"os"
)
@@ -28,6 +29,15 @@ func run() error {
if err != nil {
return err
}
+
+ store.AddQueryHook(bundebug.NewQueryHook(
+ bundebug.WithEnabled(st.Config.Debug),
+ ))
+
+ if err := db.DoMigrations(store); err != nil {
+ return err
+ }
+
st.Data = store
server, err := http.New(st)