An "attachment" is a writ issued by a clerk of a court under seal, or by any magistrate, or by the foreman of a grand jury, in any criminal action or proceeding authorized by law, commanding some peace officer to take the body of a witness and bring him before such court, magistrate or grand jury on a day named, or forthwith, to testify in behalf of the State or of the defendant, as the case may be. It shall be dated and signed officially by the officer issuing it.
Tex. Code Crim. Proc. § 24.11