feat: 实现 SQLite 迁移备份、完整表结构与简单写入队列

This commit is contained in:
Nixevol
2026-09-30 06:29:12 +08:00
parent f9351e8b61
commit 7582e8b55e
7 changed files with 549 additions and 56 deletions
+1 -5
View File
@@ -35,16 +35,12 @@ func runServe(ctx context.Context, cfg config.Config) error {
return fmt.Errorf("mkdir data_dir: %w", err)
}
db, err := store.OpenWriter(cfg.DataDir, cfg.SQLiteSynchronous)
db, err := store.Open(cfg.DataDir, cfg.SQLiteSynchronous)
if err != nil {
return err
}
defer func() { _ = db.Close() }()
if migErr := store.Migrate(db); migErr != nil {
return migErr
}
mux := http.NewServeMux()
mux.HandleFunc("GET /healthz", func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)