This is a proof-of-concept clinical trial testing the effects of linagliptin versus glipizide on glucose variability among people with type 2 diabetes and stage 3-4 CKD. In a cross-over design, each enrolled participant will receive 28 days of each study medication. Study medications will be provided in a randomly assigned order without blinding. The primary study outcome is glucose time in range, measured by blinded continuous glucose monitoring for the last 6 days of each 28-day treatment period. Secondary outcomes include indices of glycemic variability, hypoglycemia, and biomarkers of systemic inflammation, oxidative stress, and albuminuria. The overall goal of this research is to identify safe and effective treatments to control glycemia among patients with diabetes and CKD.