The primary objective is to conduct a pilot trial of IV ketamine + TAU vs. midazolam + TAU to estimate sample size for a full-scale RCT examining these treatments for decreasing SI among depressed inpatients with MDD and bipolar depression.