When the application for writ of mandamus to the court is made without notice to the adverse party, and the writ be allowed, the alternative writ must be first issued; but if the application be upon due notice, and the writ be allowed, the peremptory writ may be issued in the first instance. The notice of the application, when given, must be at least ten days.
SDCL 21-29-5