Melatonin while pregnant

L

Does anyone use melatonin to help them sleep at night? Is your doctor okay with it? I have a ridiculous sleep cycle that wakes me up and prevents me from getting back to sleep so I end up with 4 hours of sleep and awake for hours at a time. Before I was pregnant I would take it when I wanted to sleep in but now I can’t sleep at all. I have an appointment in two weeks and I’ll probably bring it up then but just wanted some opinions. I’m 12 weeks today if that makes a difference.