| 34 | } |
| 35 | |
| 36 | func (s *SQLiteStore) Store(ctx context.Context, ev event.Event) error { |
| 37 | payload, _ := json.Marshal(json.RawMessage(ev.Payload)) |
| 38 | _, err := s.db.ExecContext(ctx, |
| 39 | `INSERT INTO events (uuid, type, payload, timestamp, project, is_pinned) VALUES (?, ?, ?, ?, ?, ?)`, |
| 40 | ev.UUID, ev.Type, string(payload), fmt.Sprintf("%.6f", ev.Timestamp), ev.Project, boolToInt(ev.IsPinned), |
| 41 | ) |
| 42 | return err |
| 43 | } |
| 44 | |
| 45 | func (s *SQLiteStore) FindByUUID(ctx context.Context, uuid string) (*event.Event, error) { |
| 46 | row := s.db.QueryRowContext(ctx, |