… while [David] pines away with grief, and is deprived of all strength, he is nevertheless supported by so strong a hope that he ceases not to call upon God. David, therefore, was not so overwhelmed in deep sorrow, and other direful sufferings, as that the hidden light of faith could not shine inwardly in his heart; nor did he groan so much under the weighty load of his temptations, as to be prevented from arousing himself to call upon God.
He struggled through many obstacles to be able to make the confession which he here makes. He next defines the manner of his faith, namely, that he reflected with himself thus that God would never fail him nor forsake him. Let us mark his manner of speech: “I have said, Thou art my God”. In these words he intimates that he was so entirely persuaded of this truth, that God was his God, that he would not admit even a suggestion to the contrary. And until this persuasion prevails so as to take possession of our minds, we shall always waver in uncertainty.
Source: Calvin’s Commentaries (Psalm 31:14)