The results of this study indicate that SGLT2 inhibitors increase the risk of obsessive-compulsive disorder, which has been verified through colocalization analysis. Here, SLC5A2 is linked to obsessive-compulsive disorder.