MCPcopy Create free account
hub / github.com/buggregator/server / Store

Method Store

internal/storage/sqlite.go:36–43  ·  view source on GitHub ↗
(ctx context.Context, ev event.Event)

Source from the content-addressed store, hash-verified

34}
35
36func (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
45func (s *SQLiteStore) FindByUUID(ctx context.Context, uuid string) (*event.Event, error) {
46 row := s.db.QueryRowContext(ctx,

Callers 5

TestSQLiteStore_FindAllFunction · 0.95
TestSQLiteStore_DeleteFunction · 0.95

Calls 1

boolToIntFunction · 0.85

Tested by 5

TestSQLiteStore_FindAllFunction · 0.76
TestSQLiteStore_DeleteFunction · 0.76