If you were on metformin before pregnancy to treat PCOS and/or lower miscarriage risks, how long did your doctor keep you on it during pregnancy?

I've heard conflicting things and trying to figure out the reasoning before I see my OB next week.