Skip to content

Commit 18d43a4

Browse files
committed
Merge branch 'master' of github.com:mmottl/postgresql-ocaml
2 parents 58a4465 + fe57063 commit 18d43a4

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

examples/async.ml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,19 @@ let test (c : connection) =
7979
Printf.printf "%s %s %s\n"
8080
(r#getvalue i 0) (r#getvalue i 1) (r#getvalue i 2)
8181
done;
82+
83+
(* Run it in single-row mode. *)
8284
c#send_query_prepared "test_sel";
83-
for i = 0 to 1 do
85+
c#set_single_row_mode;
86+
for i = 0 to 2 do
8487
match fetch_result c with
8588
| None -> assert false
86-
| Some r ->
89+
| Some r when i < 2 ->
8790
assert (r#status = Single_tuple);
8891
Printf.printf "%s %s %s\n"
89-
(r#getvalue i 0) (r#getvalue i 1) (r#getvalue i 2)
92+
(r#getvalue 0 0) (r#getvalue 0 1) (r#getvalue 0 2)
93+
| Some r ->
94+
assert (r#status = Tuples_ok)
9095
done;
9196
assert (fetch_result c = None)
9297

src/postgresql.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ val string_of_ftype : ftype -> string
205205
(** [string_of_ftype ftype] converts [ftype] to a string. *)
206206

207207
val ftype_of_string : string -> ftype
208-
(** [string_of_ftype ftype] converts [ftype] to a string. *)
208+
(** [string_of_ftype ftype] converts string to a [ftype]. *)
209209

210210

211211
(** {2 Handling results of commands and queries} *)

0 commit comments

Comments
 (0)