As to any intermediate order made before trial, as to which an appeal is not allowed as a matter of right, either the state or the defendant may be permitted to appeal to the Supreme Court, not as a matter of right, but of sound judicial discretion, such appeal to be allowed by the Supreme Court only when the court considers that the ends of justice will be served by the determination of the questions involved without awaiting the final determination of the action. The procedure as to the taking of such appeal, petition for allowance thereof, and allowance thereof, shall be as set forth in §§ 15-26A-13 to 15-26A-17, inclusive, so far as the same are applicable.
SDCL 23A-32-12