(ctx context.Context, projectID string, taskRunUID int64, t time.Time, replicaID string, e *storepb.TaskRunLog)
| 26 | } |
| 27 | |
| 28 | func (s *Store) CreateTaskRunLog(ctx context.Context, projectID string, taskRunUID int64, t time.Time, replicaID string, e *storepb.TaskRunLog) error { |
| 29 | e.ReplicaId = replicaID |
| 30 | p, err := protojson.Marshal(e) |
| 31 | if err != nil { |
| 32 | return errors.Wrapf(err, "failed to marshal task run log") |
| 33 | } |
| 34 | |
| 35 | q := qb.Q().Space(` |
| 36 | INSERT INTO task_run_log ( |
| 37 | project, |
| 38 | task_run_id, |
| 39 | created_at, |
| 40 | payload |
| 41 | ) VALUES ( |
| 42 | ?, |
| 43 | ?, |
| 44 | ?, |
| 45 | ? |
| 46 | ) |
| 47 | `, projectID, taskRunUID, t, p) |
| 48 | |
| 49 | sql, args, err := q.ToSQL() |
| 50 | if err != nil { |
| 51 | return errors.Wrapf(err, "failed to build sql") |
| 52 | } |
| 53 | |
| 54 | if _, err := s.GetDB().ExecContext(ctx, sql, args...); err != nil { |
| 55 | return errors.Wrapf(err, "failed to create task run log") |
| 56 | } |
| 57 | return nil |
| 58 | } |
| 59 | |
| 60 | func (s *Store) ListTaskRunLogs(ctx context.Context, projectID string, taskRunUID int64) ([]*TaskRunLog, error) { |
| 61 | q := qb.Q().Space(` |
no test coverage detected