They had almost consumed me upon earth, as to my present life and all my happiness upon earth; whereby he implies that his immortal soul and eternal happiness in heaven, of which he speaks, Psalms 16:11, Psalms 17:15, and elsewhere, was safe, and out of their reach.
Related Commentaries of Psalms 119:87
Psalms 119:87
87 They had almost consumed me upon earth; but I forsook not thy precepts.