Whenever a deposition is taken at the instance of the prosecuting attorney, or whenever a deposition is taken at the instance of a defendant who is unable to bear the expenses of the taking of the deposition, the court may direct that the expense of travel and subsistence of the defendant and his attorney for attendance at the examination and the cost of the transcript of the deposition shall be paid by the appropriate governmental unit.
SDCL 23A-12-3