AbstractObjectiveTo assess whether use of glucagon-like peptide-1 (GLP-1) receptor agonists before upper gastrointestinal endoscopy is associated with increased risk of pulmonary aspiration or discontinuation of the procedure compared with sodium-glucose cotransporter-2 (SGLT-2) inhibitors.DesignCohort study.SettingTwo deidentified US commercial healthcare databases.Participants43 365 adults (≥18 years) with type 2 diabetes who used a GLP-1 receptor agonist or SGLT-2 inhibitor within 30 days before upper gastrointestinal endoscopy.Main outcome measuresThe primary outcome was pulmonary aspiration on the day of or the day after endoscopy, defined using diagnostic codes. The secondary outcome was discontinuation of endoscopy. Risk ratios and corresponding 95% confidence intervals (CIs) were estimated after fine stratification weighting based on propensity score.ResultsAfter weighting, 24 817 adults used a GLP-1 receptor agonist (mean age 59.9 years; 63.6% female) and 18 537 used an SGLT-2 inhibitor (59.8 years; 63.7% female). Among users of GLP-1 receptor agonists and SGLT-2 inhibitors, the weighted risk per 1000 people was, respectively, 4.15 and 4.26 for pulmonary aspiration and 9.79 and 4.91 for discontinuation of endoscopy. Compared with SGLT-2 inhibitor use, GLP-1 receptor agonist use was not associated with an increased risk of pulmonary aspiration (pooled risk ratio 0.98, 95% CI 0.73 to 1.31), although it was associated with a higher risk for discontinuation of endoscopy (1.99, 1.56 to 2.53).ConclusionsIn this comparative cohort study, no increased risk of pulmonary aspiration during upper gastrointestinal endoscopy was observed among adults with type 2 diabetes using GLP-1 receptor agonists compared with SGLT-2 inhibitors within 30 days of the procedure; however, GLP-1 receptor agonists were associated with a higher risk of discontinuation of endoscopy, possibly owing to a higher risk of retained gastric content. In the absence of evidence from randomized trials, these findings could inform future practice recommendations on the preprocedural protocol for patients requiring endoscopy.