Metformin 500mg? 21 weeks pregnant

Anyone else take this? My sugar sometimes is 110 early in the morning when I wake up and doctor wants me to take ONE (500mg) pill every day around dinner time before I sleep.
(So it can regulate my sugars while I sleep?)
What did you guys experience? Did it help? Is it safe for the baby?
I hate taking unnecessary pills.