feat(activity): add SQLite schema and cache initialization #288
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/steeper!288
Loading…
Reference in a new issue
No description provided.
Delete branch "phase01-cache-schema"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Add
internal/activity/cache.gowith SQLite database initialization and thedaily_activitytable schema. This is the persistence layer for the activity view feature.Schema
API
Dependencies
Added
modernc.org/sqlite(pure Go, no CGO) for zero-dependency builds.Why
Foundation for caching pre-aggregated daily activity data. The table design matches the cache strategy defined in
activity.md: past dates are immutable, current date has 5-minute TTL.References: #176, #170, #171
Testing
golangci-lint run ./internal/activity/— 0 issuesgo vet ./internal/activity/— 0 issuesgo test ./...— all passa5459799c1bb28038a99Review
Result: Approved — no blocking issues.
Summary: Adds
internal/activity/cache.gowith SQLite database initialization (Open,Close,migrate) anddaily_activitytable schema. Usesmodernc.org/sqlite(pure Go, no CGO). 13 subtests pass covering in-memory open, invalid path, table/index creation, idempotent migration, and close safety. Also includesROADMAP2.md(full project plan) andactivity.md(design document).Non-blocking issues filed:
SetMaxOpenConns(1)fetched_atTEXT format andCacheconcurrency safetyChecklist: