summaryrefslogtreecommitdiff
path: root/internal/store/sqlite.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/store/sqlite.go')
-rw-r--r--internal/store/sqlite.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/store/sqlite.go b/internal/store/sqlite.go
index c97d0af..79f5cc8 100644
--- a/internal/store/sqlite.go
+++ b/internal/store/sqlite.go
@@ -167,6 +167,12 @@ func (s *Store) GetTasks() ([]models.Task, error) {
return tasks, rows.Err()
}
+// DeleteTask removes a task from the cache by ID
+func (s *Store) DeleteTask(id string) error {
+ _, err := s.db.Exec(`DELETE FROM tasks WHERE id = ?`, id)
+ return err
+}
+
// Notes operations
// SaveNotes saves multiple notes to the database
@@ -403,6 +409,12 @@ func (s *Store) IsCacheValid(key string) (bool, error) {
return cm.IsCacheValid(), nil
}
+// InvalidateCache removes the cache metadata for a given key, forcing a refresh on next fetch
+func (s *Store) InvalidateCache(key string) error {
+ _, err := s.db.Exec(`DELETE FROM cache_metadata WHERE key = ?`, key)
+ return err
+}
+
// Boards operations
// SaveBoards saves multiple boards to the database
@@ -538,3 +550,9 @@ func (s *Store) GetBoards() ([]models.Board, error) {
return boards, cardRows.Err()
}
+
+// DeleteCard removes a card from the cache by ID
+func (s *Store) DeleteCard(id string) error {
+ _, err := s.db.Exec(`DELETE FROM cards WHERE id = ?`, id)
+ return err
+}