summaryrefslogtreecommitdiff
path: root/internal/cli
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-14 11:22:02 +0300
committerPaul Buetow <paul@buetow.org>2026-04-14 11:22:02 +0300
commitc19666bd44b938ab2627b0c85935d3877c88b373 (patch)
tree434e7d2942cd79428106c2f8ede74d8309f1a6d3 /internal/cli
parent55593e14ee2a4225d1db1058da9d8d1f663225b6 (diff)
refactor: drop goprecords DB pass-through, use storage from CLI (x3)
Remove OpenDB/CreateSchema/ResetRecords/ImportFromDir/ImportFromFS wrappers and sqlite blank import from goprecords; keep LoadAggregates. CLI and integration tests call storage.* directly. Storage-focused tests live under internal/storage. Made-with: Cursor
Diffstat (limited to 'internal/cli')
-rw-r--r--internal/cli/cli.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/cli/cli.go b/internal/cli/cli.go
index 7dd7cb6..81ebc40 100644
--- a/internal/cli/cli.go
+++ b/internal/cli/cli.go
@@ -12,6 +12,7 @@ import (
"codeberg.org/snonux/goprecords/internal/authkeys"
"codeberg.org/snonux/goprecords/internal/daemon"
"codeberg.org/snonux/goprecords/internal/goprecords"
+ "codeberg.org/snonux/goprecords/internal/storage"
"codeberg.org/snonux/goprecords/internal/version"
)
@@ -62,15 +63,15 @@ func runImport(args []string) error {
return fmt.Errorf("missing -stats-dir")
}
ctx := context.Background()
- db, err := goprecords.OpenDB(ctx, *dbPath)
+ db, err := storage.Open(ctx, *dbPath)
if err != nil {
return fmt.Errorf("open db: %w", err)
}
defer db.Close()
- if err := goprecords.CreateSchema(ctx, db); err != nil {
+ if err := storage.CreateSchema(ctx, db); err != nil {
return fmt.Errorf("schema: %w", err)
}
- if err := goprecords.ImportFromDir(ctx, db, *statsDir); err != nil {
+ if err := storage.ImportFromDir(ctx, db, *statsDir); err != nil {
return fmt.Errorf("import: %w", err)
}
fmt.Fprintf(os.Stderr, "imported %s into %s\n", *statsDir, *dbPath)
@@ -85,7 +86,7 @@ func runQuery(args []string) error {
return err
}
ctx := context.Background()
- db, err := goprecords.OpenDB(ctx, *dbPath)
+ db, err := storage.Open(ctx, *dbPath)
if err != nil {
return fmt.Errorf("open db: %w", err)
}