Library
Module
Module type
Parameter
Class
Class type
The 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 ]) result Lwt.t
returned_count resp
is the number of rows returned by resp
. This function may not be available for all databases.
val affected_count :
('b, 'm) t ->
(int, [> Caqti_error.retrieve | `Unsupported ]) result Lwt.t
affected_count resp
is the number of rows affected by the updated the produced resp
. This function may not be available for all databases.
val exec :
(unit, [< `Zero ]) t ->
(unit, [> Caqti_error.retrieve ]) result Lwt.t
exec resp
checks that resp
succeeded with no result rows.
val find : ('b, [< `One ]) t -> ('b, [> Caqti_error.retrieve ]) result Lwt.t
find 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 ]) result Lwt.t
find_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 ]) result Lwt.t
fold f resp
folds f
over the decoded rows returned in resp
.