From 368a3cf0627f5e06cda5fdc0dfb0f249b10da03a Mon Sep 17 00:00:00 2001 From: Patryk Hegenberg Date: Tue, 23 Sep 2025 14:58:31 +0200 Subject: [PATCH] fix: change interface{} to any in local_storage.go --- local_storageV2.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/local_storageV2.go b/local_storageV2.go index 58f1f39..cf0897c 100644 --- a/local_storageV2.go +++ b/local_storageV2.go @@ -141,7 +141,7 @@ func (s *SQLiteStorage) StoreBatch(ctx context.Context, entries []LogEntry) erro func (s *SQLiteStorage) Query(ctx context.Context, query StorageQuery) ([]LogEntry, error) { sqlQuery := "SELECT service, timestamp, type, host, tool, log_level, log_message, raw, priority, priority_name, unit, pid, boot_id, machine_id, fields, service_information, system_metrics, tool_information FROM log_entries WHERE 1=1" - args := []interface{}{} + args := []any{} argCount := 0 if !query.StartTime.IsZero() { @@ -252,11 +252,11 @@ func (s *SQLiteStorage) MarkAsExported(ctx context.Context, ids []int64) error { } placeholders := strings.Repeat("?,", len(ids)) - placeholders = placeholders[:len(placeholders)-1] // Remove trailing comma + placeholders = placeholders[:len(placeholders)-1] sqlQuery := fmt.Sprintf("UPDATE log_entries SET exported_at = CURRENT_TIMESTAMP WHERE id IN (%s)", placeholders) - args := make([]interface{}, len(ids)) + args := make([]any, len(ids)) for i, id := range ids { args[i] = id } @@ -266,11 +266,6 @@ func (s *SQLiteStorage) MarkAsExported(ctx context.Context, ids []int64) error { } func (s *SQLiteStorage) GetUnexportedEntries(ctx context.Context, limit int) ([]LogEntry, error) { - // query := StorageQuery{ - // Limit: limit, - // OrderBy: "timestamp", - // } - sqlQuery := `SELECT id, service, timestamp, type, host, tool, log_level, log_message, raw, priority, priority_name, unit, pid, boot_id, machine_id, fields, service_information, system_metrics, tool_information FROM log_entries WHERE exported_at IS NULL ORDER BY timestamp ASC`