@@ -116,7 +116,8 @@ type result_status =
116
116
| Nonfatal_error
117
117
| Fatal_error
118
118
| Copy_both
119
- | Single_tuple (* * One tuple of a result set ({!set_single_row_mode}) *)
119
+ | Single_tuple
120
+ (* * One tuple of a result set ({!connection.set_single_row_mode}) *)
120
121
121
122
(* * Result of put_copy_data and put_copy_end *)
122
123
type put_copy_result =
@@ -482,7 +483,8 @@ val conndefaults : unit -> conninfo_option array
482
483
483
484
@param startonly
484
485
If true, initiate a non-blocking connect procedure, which involves
485
- cooperative calls to {!connect_poll} before the connection is usable.
486
+ cooperative calls to {!connection.connect_poll} before the connection is
487
+ usable.
486
488
487
489
@raise Error if there is a connection failure. *)
488
490
class connection :
@@ -545,8 +547,9 @@ object
545
547
546
548
{e Warning:} This function is unsafe in combination with a number of libpq
547
549
entry points, and should not be used for now. As a workaround,
548
- {!#set_notice_processing} can be used to silence notices, if this is more
549
- appropriate than the default behaviour of printing them to standard error.
550
+ {!connection.set_notice_processing} can be used to silence notices, if
551
+ this is more appropriate than the default behaviour of printing them to
552
+ standard error.
550
553
551
554
@raise Error if there is a connection error. *)
552
555
@@ -696,15 +699,15 @@ object
696
699
method describe_prepared : string -> result
697
700
(* * [#describe_prepared stm_name] submits a request to obtain information
698
701
about the specified prepared statement, and waits for completion.
699
- {!describe_prepared} allows an application to obtain information about a
700
- previously prepared statement. The [stm_name] parameter can be the empty
701
- string ("") to reference the unnamed statement, otherwise it must be the
702
- name of an existing prepared statement. On success, a {!result} with
703
- status [Command_ok] is returned. The methods {!result.nparams} and
704
- {!result.paramtype} of the class [result] can be used to obtain
705
- information about the parameters of the prepared statement, and the
706
- methods {!result.nfields}, {!result.fname} and {!result.ftype} provide
707
- information about the result columns (if any) of the statement.
702
+ {!connection. describe_prepared} allows an application to obtain
703
+ information about a previously prepared statement. The [stm_name]
704
+ parameter can be the empty string ("") to reference the unnamed statement,
705
+ otherwise it must be the name of an existing prepared statement. On
706
+ success, a {!result} with status [Command_ok] is returned. The methods
707
+ {!result.nparams} and {!result. paramtype} of the class [result] can be
708
+ used to obtain information about the parameters of the prepared statement,
709
+ and the methods {!result.nfields}, {!result.fname} and {!result.ftype}
710
+ provide information about the result columns (if any) of the statement.
708
711
709
712
To prepare a statement use the SQL command PREPARE.
710
713
@@ -741,16 +744,18 @@ object
741
744
742
745
method send_prepare : ?param_types :oid array -> string -> string -> unit
743
746
(* * [#send_prepare ?param_types stm_name query] sends a query preparation
744
- without waiting for the result. This does the same as {!prepare} except
745
- that the status is reported by {!get_result} when available.
747
+ without waiting for the result. This does the same as
748
+ {!connection.prepare} except that the status is reported by
749
+ {!connection.get_result} when available.
746
750
747
751
@raise Error if there is a connection error. *)
748
752
749
753
method send_query_prepared :
750
754
?params :string array -> ?binary_params :bool array -> string -> unit
751
755
(* * [#send_query_prepared ?params ?binary_params stm_name] is an asynchronous
752
- version of {!query_prepared}. The semantics is otherwise the same, and the
753
- result is reported by {!get_result} when available.
756
+ version of {!connection.exec_prepared}. The semantics is otherwise the
757
+ same, and the result is reported by {!connection.get_result} when
758
+ available.
754
759
755
760
@param params default = [||]
756
761
@param binary_params default = [||]
@@ -760,20 +765,22 @@ object
760
765
method send_describe_prepared : string -> unit
761
766
(* * [#send_describe_prepared stm_name] sends a request for a description of a
762
767
prepared query without waiting for the result. The result must be fetched
763
- with {!get_result} when it becomes available. Otherwise it does the same
764
- as {!describe_prepared}.
768
+ with {!connection. get_result} when it becomes available. Otherwise it does
769
+ the same as {!connection. describe_prepared}.
765
770
766
771
@raise Error if there is a connection error. *)
767
772
768
773
method send_describe_portal : string -> unit
769
774
(* * [#send_describe_portal portal_name] sends a request for a description of
770
- the named portal. The result must be fetched with {!get_result}.
775
+ the named portal. The result must be fetched with
776
+ {!connection.get_result}.
771
777
772
778
@raise Error if there is a connection error. *)
773
779
774
780
method set_single_row_mode : unit
775
- (* * [#set_single_row_mode] called right after {!send_query} or a sibling
776
- function causes the returned rows to be split into individual results. *)
781
+ (* * [#set_single_row_mode] called right after {!connection.send_query} or a
782
+ sibling function causes the returned rows to be split into individual
783
+ results. *)
777
784
778
785
method get_result : result option
779
786
(* * [get_result]
@@ -802,7 +809,7 @@ object
802
809
connection in [Command_ok] or failed state. In non-blocking mode, returns
803
810
{!Put_copy_not_queued} if the termination message was not queued due to
804
811
full buffers. Also, to ensure delivery of data in non-blocking mode,
805
- repeatedly wait for write-ready an call {!# flush}.
812
+ repeatedly wait for write-ready an call {!connection. flush}.
806
813
807
814
@param error_msg
808
815
if set, force the copy operation to fail with the given message. *)
@@ -812,7 +819,8 @@ object
812
819
Only single complete rows are returned. In synchronous mode, the call will
813
820
wait for completion of the next row. In asynchronous mode it will return
814
821
immediately with [Get_copy_wait] if the row transfer is incomplete. In
815
- that case, wait for read-ready and call {!#consume_input} before retrying.
822
+ that case, wait for read-ready and call {!connection.consume_input} before
823
+ retrying.
816
824
817
825
@param async default = false *)
818
826
@@ -884,11 +892,12 @@ object
884
892
(* * Asynchronous operations and non blocking mode *)
885
893
886
894
method connect_poll : polling_status
887
- (* * After creating a connection with [~startonly:true], {!connect_poll} must
888
- be called a number of times before the connection can be used. The precise
889
- procedure is described in the libpq manual, but the following code should
890
- capture the idea, assuming monadic concurrency primitives [return] and
891
- [>>=] along with polling functions [wait_for_read] and [wait_for_write]:
895
+ (* * After creating a connection with [~startonly:true],
896
+ {!connection.connect_poll} must be called a number of times before the
897
+ connection can be used. The precise procedure is described in the libpq
898
+ manual, but the following code should capture the idea, assuming monadic
899
+ concurrency primitives [return] and [>>=] along with polling functions
900
+ [wait_for_read] and [wait_for_write]:
892
901
{[
893
902
let my_async_connect () =
894
903
let c = new connection () in
@@ -906,11 +915,12 @@ object
906
915
See also [examples/async.ml]. *)
907
916
908
917
method reset_start : bool
909
- (* * An asynchronous variant of {!reset}. Use {!reset_poll} to finish
910
- re-establishing the connection. *)
918
+ (* * An asynchronous variant of {!connection. reset}. Use
919
+ {!connection.reset_poll} to finish re-establishing the connection. *)
911
920
912
921
method reset_poll : polling_status
913
- (* * Used analogously to {!connect_poll} after calling {!reset_start}. *)
922
+ (* * Used analogously to {!connection.connect_poll} after calling
923
+ {!connection.reset_start}. *)
914
924
915
925
method set_nonblocking : bool -> unit
916
926
(* * [set_nonblocking b] sets state of the connection to nonblocking if [b] is
0 commit comments