Typically people with diabetes while pregnant are treated with diet, and if diet alone cannot control blood sugars then they are given insulin. This is because these drugs can cross the placenta and affect the baby. However, insulin does not cross the placenta.
Controlling blood sugar to normal levels during pregnancy is important to having a healthy pregnancy. Best wishes.