MCPcopy Index your code
hub / github.com/bytebase/bytebase / CreateTaskRunLog

Method CreateTaskRunLog

backend/store/task_run_log.go:28–58  ·  view source on GitHub ↗
(ctx context.Context, projectID string, taskRunUID int64, t time.Time, replicaID string, e *storepb.TaskRunLog)

Source from the content-addressed store, hash-verified

26}
27
28func (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
60func (s *Store) ListTaskRunLogs(ctx context.Context, projectID string, taskRunUID int64) ([]*TaskRunLog, error) {
61 q := qb.Q().Space(`

Callers 15

CreateTaskRunLogSMethod · 0.95
LogComputeDiffStartMethod · 0.80
LogComputeDiffEndMethod · 0.80
LogDatabaseSyncStartMethod · 0.80
LogDatabaseSyncEndMethod · 0.80
LogSchemaDumpStartMethod · 0.80
LogSchemaDumpEndMethod · 0.80
LogCommandExecuteMethod · 0.80
LogCommandResponseMethod · 0.80
LogGhostMigrationEndMethod · 0.80
LogRetryInfoMethod · 0.80

Calls 4

GetDBMethod · 0.95
QFunction · 0.92
SpaceMethod · 0.80
ToSQLMethod · 0.80

Tested by

no test coverage detected