This cohort study compares the incidence of atrial fibrillation in patients with type 2 diabetes associated with use of sodium-glucose cotransporter-2 inhibitors with dipeptidyl peptidase-4 inhibitors or glucagonlike peptide-1 receptor agonists. Here, SLC5A2 is linked to type 2 diabetes mellitus.