Can high blood sugar cause mood swings?

I recently got diagnosed with gestational diabetes the doctors put me on Glyburide and I have felt my mood improve significantly ever since. This has been blowing my mind because I have had chronic depression and panic disorder since I was about 10 years old. I have never known a day where I have felt at peace with myself and the world and now I feel so calm when my blood sugar numbers are low. I get really aggrivated and depressed when the meds wear off and the numbers shoot up again so it's lead me to believe that maybe I have had issues with blood sugar for a long time and never got properly diagnosed? Diabetes runs in my family so I am thinking it could be possible.

Is there any evidence of depression/anxiety being caused by blood sugar being too high or am I just getting weird side effects from my medicine?