On electrolysis of CaH2 solution in water, O2 gas is liberated at anode and H2 gas is liberated at cathode.
At cathode, 2H++2e−→H2↑
At anode, 4OH−→2H2O+O2+4e−
The discharge potential of H+ ions is lower than the discharge potential of Ca2+ ions.
Similarly, the discharge potential of hydroxide ions is lower than the discharge potential of hydride ions.