Commits

Dmitry Grebeniuk  committed c7888b8

dbi: result: + #map_t_to_list

  • Participants
  • Parent commits e7bbb93

Comments (0)

Files changed (1)

File src/dbi/dbi_pg.ml

     ;
 
 
+    method map_t_to_list : !'a. (array sql_t -> 'a) -> list 'a = fun f ->
+      let rev_acc = ref [] in
+      let () = self#iter_t
+        (fun row ->
+          rev_acc.val := [(f row) :: rev_acc.val]
+        )
+      in
+      List.rev rev_acc.val
+    ;
+
+
 (*
     method fetchall_array () : array (array sql_t) = [| [|  |] |];
     method fetchall_list () : list (array sql_t) = [ [| |] ];