Caqti_response_sig.SThe type describing the response and containing returned data from a request execution.
'b is the type of a single row'm is the possible multiplicities of rowsval returned_count :
('b, 'm) t ->
(int, [> Caqti_error.retrieve | `Unsupported ]) Stdlib.result fiberreturned_count resp is the number of rows returned by resp. This function may not be available for all drivers.
val affected_count :
('b, 'm) t ->
(int, [> Caqti_error.retrieve | `Unsupported ]) Stdlib.result fiberaffected_count resp is the number of rows affected by the updated the produced resp. This function may not be available for all drivers.
val exec :
(unit, [< `Zero ]) t ->
(unit, [> Caqti_error.retrieve ]) Stdlib.result fiberexec resp checks that resp succeeded with no result rows.
val find :
('b, [< `One ]) t ->
('b, [> Caqti_error.retrieve ]) Stdlib.result fiberfind resp checks that resp succeeded with a single row, and returns the decoded row.
val find_opt :
('b, [< `Zero | `One ]) t ->
('b option, [> Caqti_error.retrieve ]) Stdlib.result fiberfind_opt resp checks that resp succeeded with at most one row, and returns the row if any.
val fold :
('b -> 'c -> 'c) ->
('b, 'm) t ->
'c ->
('c, [> Caqti_error.retrieve ]) Stdlib.result fiberfold f resp folds f over the decoded rows returned in resp.
val fold_s :
('b -> 'c -> ('c, 'e) Stdlib.result fiber) ->
('b, 'm) t ->
'c ->
('c, [> Caqti_error.retrieve ] as 'e) Stdlib.result fiberfold_s f resp folds f over the decoded rows returned by resp within the IO and result monad.
Note. Do not make nested queries in the callback to this function. If you use the same connection, it may lead to data corruption. If you pull a different connection from the same pool, it may deadlock if the pool runs out of connections. Also, some drivers may not support simpltaneous connections.
val iter_s :
('b -> (unit, 'e) Stdlib.result fiber) ->
('b, 'm) t ->
(unit, [> Caqti_error.retrieve ] as 'e) Stdlib.result fiberiter_s f resp iterates f over the decoded rows returned by resp within the IO and result monad.
Note. Do not make nested queries in the callback to this function. Cf. fold_s.
val to_stream : ('b, 'm) t -> ('b, [> Caqti_error.retrieve ] as 'err) streamto_stream resp returns a stream whose elements are the decoded rows returned by resp.