@@ -22,7 +22,8 @@ func main() {
2222
2323 totalGroups := flag .Bool ("total-groups" , false , "Display total number of groups (view mode)" )
2424 groupID := flag .Int ("group" , 0 , "Display results for a specific group ID (view mode)" )
25-
25+ deleteGroupID := flag .Int ("delete-group-id" , 0 , "Delete a specific group ID and all its associated results" )
26+
2627 n := flag .Int ("n" , 10 , "Number of results to display (view mode)" )
2728
2829 queueN := flag .Int ("queue-n" , 10 , "Number of queued jobs to display (for view action)" )
@@ -47,6 +48,14 @@ func main() {
4748 RunClient (ctx , driver , * argsJSON , * metadataJSON , * bulkFile , dbPool )
4849 case "worker" :
4950 RunWorker (ctx , driver , cancel , dbPool )
51+ case "delete-group" :
52+ if * deleteGroupID == 0 {
53+ log .Fatal ().Msg ("Please provide --delete-group-id" )
54+ }
55+ if err := DeleteGroupAndResults (ctx , dbPool , * deleteGroupID ); err != nil {
56+ log .Fatal ().Err (err ).Msg ("Failed to delete group and results" )
57+ }
58+ log .Info ().Int ("group_id" , * deleteGroupID ).Msg ("Deleted group and associated results" )
5059 case "view" :
5160 if * totalGroups {
5261 if err := viewTotalGroups (ctx , dbPool ); err != nil {
0 commit comments