In patients with diabetes and COVID-19, metformin exhibited reduced risks of mechanical ventilation and death, DPP- 4i was linked with lower risks of oxygen treatment and death, while sulfonylurea was related to the increased risk of mechanical ventilation.