Each district attorney shall represent the State in all criminal cases in the district courts of his district and in appeals therefrom, except in cases where he has been, before his election, employed adversely. When any criminal proceeding is had before an examining court in his district or before a judge upon habeas corpus, and he is notified of the same, and is at the time within his district, he shall represent the State therein, unless prevented by other official duties. It shall be the primary duty of all prosecuting attorneys, including any special prosecutors, not to convict, but to see that justice is done. They shall not suppress facts or secrete witnesses capable of establishing the innocence of the accused.
Tex. Code Crim. Proc. § 2.01