@@ -23,6 +23,7 @@ type Command struct {
2323 Status string `json:"status" db:"status"`
2424 Result string `json:"result" db:"result"`
2525 Repository string `json:"repository" db:"repository"`
26+ PID int64 `json:"pid" db:"pid"`
2627}
2728
2829// GetCommandById fetches a command by its ID
@@ -91,8 +92,8 @@ func DeleteCommandsByDays(days int) error {
9192
9293// InsertCommand inserts a command into the database
9394func InsertCommand (command Command ) error {
94- query := `INSERT INTO commands (category, command, user, directory, execution_time, start_time, end_time, status, result, repository)
95- VALUES (:category, :command, :user, :directory, :execution_time, :start_time, :end_time, :status, :result, :repository)`
95+ query := `INSERT INTO commands (category, command, user, directory, execution_time, start_time, end_time, status, result, repository, pid )
96+ VALUES (:category, :command, :user, :directory, :execution_time, :start_time, :end_time, :status, :result, :repository, :pid )`
9697
9798 _ , err := database .DB .NamedExec (query , command )
9899
@@ -139,5 +140,6 @@ func MapCommandToProto(command Command) *gen.Command {
139140 Status : command .Status ,
140141 Result : command .Result ,
141142 Repository : command .Repository ,
143+ Pid : command .PID ,
142144 }
143145}
0 commit comments