This cohort study compares the effectiveness associated with sodium-glucose cotransporter 2 inhibitor vs dipeptidyl peptidase 4 inhibitor therapies on total cardiovascular disease risk and risk of atrial fibrillation, coronary heart disease, heart failure, stroke, myocardial infarction, and transient ischemic attack among patients with type 2 diabetes. This evidence concerns the gene SLC5A2 and type 2 diabetes mellitus.