Module Silo

val let* : ('a, 'b) Stdlib.result -> ('a -> ('c, 'b) Stdlib.result) -> ('c, 'b) Stdlib.result
val string : string -> Dbcaml.Params.t

String param

val number : int -> Dbcaml.Params.t

Number param

val float : float -> Dbcaml.Params.t

Float param

val bool : bool -> Dbcaml.Params.t

Bool param

val string_list : string list -> Dbcaml.Params.t

List of strings param

val number_list : int list -> Dbcaml.Params.t

List of numbers param

module type Intf = sig ... end
type t =
  1. | Ready_to_connect of {
    1. driver : (module Intf);
    2. connections : int;
    3. connection_string : string;
    }
  2. | Connected of {
    1. driver : Dbcaml.Driver.t;
    2. connections : int;
    3. connection_string : string;
    4. conn_mgr_pid : Riot.Pid.t;
    }
val config : connections:int -> driver:(module Intf) -> connection_string:string -> t

Create a new config based on the provided params.

val connect : config:t -> (t, string) Stdlib.result

Start a connection to the database. This spins up a pool and creates the amount of connections provided in the config

val have_rows : bytes -> unit option
val query : ?params:Dbcaml.Params.t list -> t -> query:string -> deserializer:'a Serde.De.t -> ('b option, string) Stdlib.result

Query send a fetch request to the database and use the bytes to deserialize the output to a type using serde. Ideal to use for select queries

val parse_command_complete : string -> (int, string) Stdlib.result

Used internally. parse_command_complete reads the "Command Complete" message which starts with a C and reads how many rows that is effected and return a int If it's unable to do so do it return a error

val execute : ?params:Dbcaml.Params.t list -> t -> query:string -> (int, string) Stdlib.result

Execute sends a execute command to the database and returns the amount of rows affected. Ideal to use for insert,update and delete queries