Page
Library
Module
Module type
Parameter
Class
Class type
Source
Caqti1_async.CONNECTIONmodule Param : Caqti1_sigs.PARAMInterface for constructing query parameters.
module Tuple : Caqti1_sigs.TUPLEInterface for extracting result tuples.
val driver_info : Caqti_driver_info.tInformation about the database driver which provides this connection.
val disconnect : unit -> unit ioCalling disconnect () closes the connection to the database and frees up related resources.
val validate : unit -> bool ioFor internal use by Caqti_pool. Tries to ensure the validity of the connection and must return false if unsuccessful.
For internal use by Caqti_pool. Called after a connection has been used. check f must call f () exactly once with an argument indicating whether to keep the connection in the pool or discard it.
val describe : (Caqti1_query.query -> Caqti1_describe.querydesc io) optionReturns a description of parameters and returned tuples. What is returned may be limited by what the underlying library supports. The number of paratemers and tuple components should be correct, but the types may be `Unknown.
val exec : Caqti1_query.query -> Param.t array -> unit ioexec q params executes a query q(params) which is not expected to return anything.
val find : Caqti1_query.query -> (Tuple.t -> 'a) -> Param.t array -> 'a iofind_e q params executes q(params) which is expected to return exactly one tuple.
val find_opt :
Caqti1_query.query ->
(Tuple.t -> 'a) ->
Param.t array ->
'a option iofind q params executes a query q(params) which is expected to return at most one tuple.
val fold :
Caqti1_query.query ->
(Tuple.t -> 'a -> 'a) ->
Param.t array ->
'a ->
'a iofold q f params acc executes q(params), composes f over the resulting tuples in order, and applies the composition to acc.
val fold_s :
Caqti1_query.query ->
(Tuple.t -> 'a -> 'a io) ->
Param.t array ->
'a ->
'a iofold_s q f params acc executes q(params), forms a threaded composition of f over the resulting tuples, and applies the composition to acc.
val iter_p :
Caqti1_query.query ->
(Tuple.t -> unit io) ->
Param.t array ->
unit iofold_p q f params executes q(params) and calls f t in the thread monad in parallel for each resulting tuple t. A certain backend may not implement parallel execution, in which case this is the same as iter_s.
val iter_s :
Caqti1_query.query ->
(Tuple.t -> unit io) ->
Param.t array ->
unit iofold_s q f params executes q(params) and calls f t sequentially in the thread monad for each resulting tuple t in order.
val start : unit -> unit ioStarts a transaction if supported by the underlying database, otherwise does nothing.
val commit : unit -> unit ioCommits the current transaction if supported by the underlying database, otherwise does nothing.
val rollback : unit -> unit ioRolls back a transaction if supported by the underlying database, otherwise does nothing.